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)
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.
Apologies, I have posted this in the wrong forum. It should be under Power Automate, not Power Apps.
WarrenBelz
109
Most Valuable Professional
Michael E. Gernaey
82
Super User 2025 Season 1
mmbr1606
71
Super User 2025 Season 1