If you have not heard of Connection References yet, they are definitely worth looking into. There are a lot of great blogs out there already, such as our blog introducing the feature, as well as our Docs information.

 

At a high-level, connection references are solution-aware components that contain a reference which associates the connector used and the flow it resides in. When importing a solution that contains a flow from one environment to the other, this prevents you from needed to open the flow and re-establish connections. In this case, we will focus on the Common Data Service(current environment) connection reference.

 

 

There a few important things I want to call out.

 

Connection references are specific to a user and connection when being automatically created or automatically used within a flow connection. Connections within a flow can be manually updated to use a connection reference from another user's connection if they exist.

 

How are connection references are created?

 

Manually, they can be created from the Power Apps maker portal. These are also specific to a user's connection.

 

From within a solution, click New and select Connect Reference (preview)

 

 

You will give it a unique name and I recommend this be unique, since that is what currently displays in the views. You will also have to select a connector and an existing connection for that connector type. If it doesn't exist, you must create it. (note: a connection for that connector must also exist for this user in the destination org)

 

 

That is pretty straight forward.


How is a connection reference automatically created? In this case, a user does not have an existing connection reference in an environment where they want to build a flow. If this user creates a flow in this environment using the Common Data Service (Current environment) trigger or action, a connection reference will automatically be created.

 

When it is created automatically, it will look like below, using a default name:

 

 

The only way you can currently find the schema name of this connection reference, is to click the ellipses from this view and click Edit. Then, you will see this as below:

 

Now, if there is more than one person creating flows that use Common Data Service (current environment) connectors in that same environment that also do not have an existing connection reference, the same thing will happen for that user.

 

This means, if the user does not already have a connection reference that they own for Common Data Service (current environment) and they create a new flow using a trigger or action for that connector, another connection reference will be created with the exact same name for this user.

 

 

However, the schema name is different.

 

 

If you extend this scenario to 10-15 people, or more, in an environment building flows, you will end up with multiple connection references that appear to be the same. This can become confusing very quick, especially during import of the solution.

 

If a user already has an existing connection reference in an environment, using Common Data Service (current environment) and they create a new flow, it will automatically set that connection reference to the connector in the flow and will not create a new connection reference.

 

As a best practice, and to prevent having multiple connection references using the same name and causing confusion, each user can create a connection reference manually with a preferred naming convention before creating any flows.

 

If you are already in this situation, users can change the display name of existing connection references or create a new connection reference with the preferred name and reassign this to the existing flows.

 

To update the connection reference once you have a new one created, open the flow in the originating org and update the connections to use the new connection reference. This will update the destination org when imported.

 

 

Known Issues

There is a known issue right now, if you create a new solution with a flow or add a flow to an existing solution the connection reference it is not added to the solution. It must be added manually. Be aware of this, especially if that connection reference doesn’t exist in the destination environment. It will fail to import. If you encounter this and have multiple connection references using the default name of Common Data Service (current environment), you will have to go find the schema name that aligns with the missing connection reference and add it to the solution in the originating environment.

 

 

Limits

 

While connection references are in preview, one connection reference can only be used within a maximum of 16 flows. If the same connection needs to be used in more than 16 flows, then create another connection reference with a connection to the same connector. 

 

What happens when you this limit? You will a message like this when trying to save the flow (click image to expand)

 

 

What happens when User A creates a solution with a flow in one environment, using a connection and connection reference of User A, but User B imports this solution to the destination environment where User A does not have an existing connection.

 

User B, when importing the solution, will have the option to select their existing connection to tie to the connection reference or create a new connection. They could select below

 

 

or click + New Connection

 

 

Otherwise, User A would need to sign-in to the flow portal for the destination environment and create a connection. This would allow the user importing the solution to select the correct connection for the connection reference.

 

 

Thanks for reading!

 

Aaron Richards

 

Sr. Customer Engineer

Dynamics 365 and Power Platform