“How can I format the values from multiple choice SharePoint column in a .csv file created by Power Automate? It shows an ugly string instead of the value(s).”
{“@odata.type”:”#Microsoft.Azure.Connectors.SharePoint.SPListExpandedReference”, “Id”:2, “Value”:”In progress”}
When working with multiple choice SharePoint columns in Power Automate, they’ll be always processed as an array. Until you run the flow, Power Automate doesn’t know what value a column contains, it knows only the list/library structure. And if the structure has a choice column with multiple choice enabled, it must be prepared to process all of them. To receive all of them in an array and process them one by one.
That’s why you don’t see the dynamic content for ‘Value’ of the multiple choice field (unlike single choice columns). Until you loop through all the choices in the array, Power Automate doesn’t know what values they contain. And since you can’t loop inside the ‘Create CSV table’ action, Power Automate will allow you to use only the full array. Even if it contains only a single choice for the given item.
{"@odata.type":"#Microsoft.Azure.Connectors.SharePoint.SPListExpandedReference", "Id":2, "Value":"In progress"}

To access only the ‘Value’, you must filter it out from the array. And since you can’t loop, it must be done using a single expression.
Build the expression
I already went through the process of building the expression in THIS post. But if you want the expression right away, it should look as below.
join(xpath(xml(json(concat('{"body":{"value":', item()?['COLUMN NAME'] , '}}'))), '/body/value/Value/text()'), ', ')
The expression above will take the whole string {“@odata…} and convert it into a valid JSON. Valid JSON can be then converted into xml, and xpath(…) will allow you to access the desired values from the array. Join(…) will just format the final output into a comma separated string.
Example
The ‘MultipleChoice’ column from the previous screenshot contains the following string, 3 choices were selected:
[{"@odata.type":"#Microsoft.Azure.Connectors.SharePoint.SPListExpandedReference","Id":0,"Value":"Choice 1"},{"@odata.type":"#Microsoft.Azure.Connectors.SharePoint.SPListExpandedReference","Id":1,"Value":"Choice 2"},{"@odata.type":"#Microsoft.Azure.Connectors.SharePoint.SPListExpandedReference","Id":2,"Value":"Choice 3"}]
You want to extract only the values, a string “Choice 1, Choice 2, Choice3”. Instead of using the dynamic content directly as on the screenshot, use the expression with the ‘MultipleChoice’ column name.
join(xpath(xml(json(concat('{"body":{"value":', item()?['MultipleChoice'] , '}}'))), '/body/value/Value/text()'), ', ')

The MultipleChoice column in the .csv file will contain the desired value: “Choice 1, Choice 2, Choice 3”.
Summary
I went much deeper into the expression in THIS article. The approach is the same, the only difference is in the value you want from the multiple choice column. Otherwise it’s the same Power Automate xpath(…) expression, only this time you extract and format the multiple choice column into a csv.
Thank you so much for this!! This is very smart!
I owe you a cyber pint. I struggled with this for a while. I fixed it in 5 mins after reading your post. I have no idea how you figured this out but I am glad you did. I tip my cap to you sir.
Thank you so much, it worked for me too! you are really life saver.
I tried your solution, but what if the multiple choice column has a null value, how does this affect your solution?
Hello Claudette,
if there’s no value then the xpath() won’t find anything = it’ll return an empty array = the outcome will be an empty value.
You BEST !!!
Hi – however hard I try I get an error when trying to run this code:
The execution of template action ‘Peripherals_CSV’ failed. The column values could not be evaluated:
‘The template language function ‘json’ parameter is not valid. The provided value ‘{“body”:{“value”:}}’
cannot be parsed: ‘Unexpected character encountered while parsing value: }. Path ‘body.value’, line 1,
position 17.’. Please see https://aka.ms/logicexpressions#json for usage details.’.
Can you guide me as to where I might be going wrong?
Resolved it – I’m new to this and didn’t know I need to precede this with Get Items actions. It works brilliantly now!
Hello Sarah,
I’m glad that you solved it. You can read from the error message that the parameters of the ‘json’ functions were not valid as it contained only ‘{“body”:{“value”:}}’ = it was completely missing the data from the SP column.
Jesus wept man…. I spent hours faffing with this and was about to give up before finding your brilliant blog and resolving things instantly! Thank you so much for sharing. Kudos.
Prior to this I had a second flow set up just to populate a slave text column, triggered on ‘item created or modified’ – which then resulted in countless more hours faffing about to prevent the infinite triggering risk!