Skip to main content

Notifications

Community site session details

Community site session details

Session Id :
Power Apps - Power Apps Pro Dev & ISV
Unanswered

Handling Identical Connection References when Copying Flows

(0) ShareShare
ReportReport
Posted on by 42

EDIT - Apologies I posted this in the wrong forum. If an admin can delete it for me that would be appreciated.

Problem: The connectionReferences array can sometimes have duplicate values. The Create Flow and Update Flow actions cannot handle these duplicates, even though they are needed for correct functioning.

Background: Our organization is building an automated system to backup, restore and move around flows to help with maintaining production and development environments. To copy a flow to somewhere else we pull the flow data, parse the connectionReferences data and map it to the new environment, and then use the Create New Flow / Update Flow actions as appropriate.

Detail: Below is an example of the connectionReferences component of an in operations flow.

 

 

 "connectionReferences": [
 {
 "connectionName": "befd187677324f96893626c4696fbce7",
 "displayName": "SQL Server",
 "id": "/providers/Microsoft.PowerApps/apis/shared_sql"
 },
 {
 "connectionName": "befd187677324f96893626c4696fbce7",
 "displayName": "SQL Server",
 "id": "/providers/Microsoft.PowerApps/apis/shared_sql"
 }
 ]

 

 

We can see that it is duplicated. If this array (appropriately parsed) is fed into a New Flow / Update Flow action, it will throw an error complaining of the duplication. (see below)

Screenshot_7.png

 

 

Can not add property shared_sql to Newtonsoft.Json.Linq.JObject. Property with the same name already exists on object.
 at Newtonsoft.Json.Linq.JObject.ValidateToken(JToken o, JToken existing)
 at Newtonsoft.Json.Linq.JContainer.InsertItem(Int32 index, JToken item, Boolean skipParentCheck)
 at Newtonsoft.Json.Linq.JContainer.AddInternal(Int32 index, Object content, Boolean skipParentCheck)

 

 

If the duplication is removed, some of the actions in the flow will be missing their associated connection.

In this example, examining the flow code, it can be seen that Power Automate is maintaining two separate connection objects - shared_sql_1 and shared_sql. See the installedConnectionReferences property below.

 

 

 "installedConnectionReferences": {
 "shared_sql": {
 "connectionName": "befd187677324f96893626c4696fbce7",
 "source": "Embedded",
 "id": "/providers/Microsoft.PowerApps/apis/shared_sql",
 ....blah blah blah....
 },
 "shared_sql_1": {
 "connectionName": "befd187677324f96893626c4696fbce7",
 "source": "Embedded",
 "id": "/providers/Microsoft.PowerApps/apis/shared_sql",
 ....blah blah blah....
 }
 }

 

 

If this was a one off, it wouldn't be a problem. However there are large numbers of flows in our organisation which can have these duplicates.

Without a solution there is no reliable way to copy, move, update, backup, or restore flows in an automated fashion.

  • Cazzym Profile Picture
    42 on at
    Re: Handling Identical Connection References when Copying Flows

    Apologies, I have posted this in the wrong forum. It should be under Power Automate, not Power Apps.

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Announcing the Engage with the Community forum!

This forum is your space to connect, share, and grow!

🌸 Community Spring Festival 2025 Challenge Winners! 🌸

Congratulations to all our community participants!

Warren Belz – Community Spotlight

We are honored to recognize Warren Belz as our May 2025 Community…

Leaderboard > Power Apps - Power Apps Pro Dev & ISV

#1
WarrenBelz Profile Picture

WarrenBelz 109 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 82 Super User 2025 Season 1

#3
mmbr1606 Profile Picture

mmbr1606 71 Super User 2025 Season 1

Overall leaderboard