web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Handling Identical Con...
Power Apps
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.

I have the same question (0)
  • Cazzym Profile Picture
    42 on at

    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

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the June Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 337 Most Valuable Professional

#2
11manish Profile Picture

11manish 173

#3
Valantis Profile Picture

Valantis 86

Last 30 days Overall leaderboard