
Hi,
I have a flow that returns a record, in that i have a collection, that collection i have to store it in a item in powerapps to populate in a combobox. what is the format for it?(The column type is multi select lookup column)
I tried this which is not working,
SelectedComplianceSafetyStandards: ForAll(
Table(ParseJSON(Text(Value.SelectedComSafStandards))),
{
Id: Value(ThisRecord.Value.Id),
Value: Text(ThisRecord.Value)
}
In Json format it is populating like this:
"SelectedComSafStandards": [
{
"@odata.type": "#Microsoft.Azure.Connectors.SharePoint.SPListExpandedReference",
"Id": 3,
"Value": "Mechanical"
},
{
"@odata.type": "#Microsoft.Azure.Connectors.SharePoint.SPListExpandedReference",
"Id": 1,
"Value": "Solvent"
},
{
"@odata.type": "#Microsoft.Azure.Connectors.SharePoint.SPListExpandedReference",
"Id": 27,
"Value": "Personal factors"
},
{
"@odata.type": "#Microsoft.Azure.Connectors.SharePoint.SPListExpandedReference",
"Id": 2,
"Value": "Electrical"
}
]
)
Kindly provide a solution
Hi @Aravindhan,
The following code did the trick for me:
ForAll(
//Replace ReferenceToJson with e.g. the variable where the text output of your flow is stored
Table(ParseJSON(ReferenceToJson).SelectedComSafStandards),
{
Id: Value(ThisRecord.Value.Id),
Value: Text(ThisRecord.Value.Value)
}
)
With the code above I would expect that your flow returns the JSON as a text field. ReferenceToJson will need to be replaced with a reference to the flow text output - this can be the flow run itself or a variable that stores the flow output. The JSON output that was shown in your topic will also need to be enclosed with curly brackets:
{
"SelectedComSafStandards": [
{
//Object 1...
},
{
//Object 2...
}
]
}
If this solves your question, would you be so kind as to accept it as a solution & give it a thumbs up.
Thanks!