WORKING
I have a working process with a similar thing I want to get working so I used this as a starting point
Process that works...
1) Get items in sharepoint
2) apply to each
a) append to an array
Details...
{
"Title": ": items('Apply_to_each')?['Title']},
"Systems": join(xpath(xml(json(concat('{"body":{"value":', items('Apply_to_each')?['Systems'], '}}'))), '/body/value/Value/text()'), ', ')
}
This works.. Systems is a multiselect sharepoint choice column
This is what I want to do...
1) get Items from sharepoint
2) compose to union an array variable with the array VALUES obtained from the get items (as I will have to get multiple get items)
3) stores in a variable (call it "Catch all").. 1,2,3 are looped through several times appending to the same array variable.
4) then i take the completed Catch all and do a select "Select" to form the Json..
- Title = item()?['Title'} and so on..
- for Systems I did every syntax combination I can think of.. with this being what I think is the closest to working.
- join(xpath(xml(json(item()?['Systems'])), '/Value/text()'), ', ')
which systems join expression yields an error of "'The template language function 'json' expects its parameter to be a string or an XML. The provided value is of type 'Array'. Please see
https://aka.ms/logicexpressions#json for usage details.'."
Please note that the output of the array variable is a Json that doesnt have a "body" with "values" structured underneath
Instead of:
- "body"
- "value"
- [0]
- "Systems": [
{- "@odata.type": "#Microsoft.Azure.Connectors.SharePoint.SPListExpandedReference",
- "Id": 0,
- "Value": "abc"
},
{ - "@odata.type": "#Microsoft.Azure.Connectors.SharePoint.SPListExpandedReference",
- "Id": 5,
"Value": "xyz"
}
], etc with other different items
- [1]
Its simply: (no "body" or "value" levels)
- [0]
- "Systems": [
{- "@odata.type": "#Microsoft.Azure.Connectors.SharePoint.SPListExpandedReference",
- "Id": 0,
- "Value": "abc"
},
{ - "@odata.type": "#Microsoft.Azure.Connectors.SharePoint.SPListExpandedReference",
- "Id": 5,
"Value": "xyz"
}
], etc with other different items
- [1]
Any help would be much appreciated