Reputation: 746
I'm trying to write a Flow that will enable me to periodically email a Sharepoint list to an email address. All works well for most columns on the list except where I have a Choice type column that has multiple select values. When I export those to my email, I get a JSON object such as below:
[{"@odata.type":"#Microsoft.Azure.Connectors.SharePoint.SPListExpandedReference","Id":0,"Value":"Choice 1"},{"@odata.type":"#Microsoft.Azure.Connectors.SharePoint.SPListExpandedReference","Id":1,"Value":"Choice 2"}]
I can find no way in the expression editor of Flow that will allow me to extract and concatenate the values, i.e. 'Choice 1, Choice 2'. It seems such a fundamentally simple thing to do! The built-in concatenation method will only take a string value and not an array of strings.
Can anyone help?
Upvotes: 1
Views: 9652
Reputation: 11
I just faced the same issue. You can get value by referring to it via item()?['Your column name']?['Value']
Upvotes: 1
Reputation: 579
The way to do this in Flow:
You can then use your variable where you want the string representation of the selections to appear.
Should you wish to not have the trailing deliminator you can fix that too.
Add a 'Text Functions' step for 'Substring' step. In that you will set values as follows:
sub(length(variables('yourVariableName')),2)
where 'yourVariableName' is the name of your variable defined in Flow for the string representation of the choices.You cannot just use this in output such as in an email template or it'll give you smack. What you need to do is use an expression where you want to display this.
Use the following where you want the output to appear:
outputs('step_name_for_substring_step')?['body']
Where 'step_name_for_substring_step' is the name of your step with underscore where you have spaces. For example, if you named your step 'myChoices prepped string list' then your expression would be outputs('myChoices_prepped_string_list')?['body']
With that you should be good to go!
Upvotes: 0