cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
cwebb365
Super User
Super User

Get a value from a String object with expressions.

So I am building an HTML table, and I have to do this somehow with expressions. I have a mutliselect choice column in SharePoint and I've been going round and round trying to get this to work and I can't for the life of me just get the Value in the column. 

 

So I've been doing join() expression and I can get each value in a string. For example, the output looks like this: 

{"@odata.type":"#Microsoft.Azure.Connectors.SharePoint.SPListExpandedReference","Id":1,"Value":"Splunk Services"},{"@odata.type":"#Microsoft.Azure.Connectors.SharePoint.SPListExpandedReference","Id":0,"Value":"Splunk Balancing"}

 

What I need to do is get "Value" from each line comma seperated. I've tried all different ways I can figure out but I just can't get it to work. Tried just extracting using concat(item()?['Column/Value'],',') etc. but that just returns blank values. Not sure if this is even possible, but bottom line is I have a raw array value that is 

[{"@odata.type":"#Microsoft.Azure.Connectors.SharePoint.SPListExpandedReference","Id":1,"Value":"Splunk Services"},{"@odata.type":"#Microsoft.Azure.Connectors.SharePoint.SPListExpandedReference","Id":0,"Value":"Splunk Balancing"}]

 

and I need to get the Values in comma seperated only and it should be way easier than it is and I just can't seem to figure it out. I can't use actions, this has to be expression based due to the way I'm looping already in this part of the flow to get those values, hence the concat/join. 

 

Thanks!

1 ACCEPTED SOLUTION

Accepted Solutions
MarconettiMarco
Super User
Super User

Hello @cwebb365 ,

here my proposal:

1. SP Get items action:

MarconettiMarco_0-1660635468852.png

 

2. Then add the following actions:

- "Select" action:

- From: your multiple selection column;

- Map: the column value

- "Compose" action putting the followig expression:

join(body('Select'),',')

MarconettiMarco_1-1660635492269.png

 

Here my output:

MarconettiMarco_2-1660635622088.pngMarconettiMarco_3-1660635633867.png

 

If I have answered your question, please mark my post as Solved.
If you like my response, please give it a Thumbs Up.

BR,

Marco

 

 

View solution in original post

4 REPLIES 4
cwebb365
Super User
Super User

First(item()?['ChoiceColumn'])?['Value'] looks perfect. But I cannot get or figure a way to get this for each value separated by comma. Figured concat/join or something would work but nothing I do can get it. Right 😞

MarconettiMarco
Super User
Super User

Hello @cwebb365 ,

here my proposal:

1. SP Get items action:

MarconettiMarco_0-1660635468852.png

 

2. Then add the following actions:

- "Select" action:

- From: your multiple selection column;

- Map: the column value

- "Compose" action putting the followig expression:

join(body('Select'),',')

MarconettiMarco_1-1660635492269.png

 

Here my output:

MarconettiMarco_2-1660635622088.pngMarconettiMarco_3-1660635633867.png

 

If I have answered your question, please mark my post as Solved.
If you like my response, please give it a Thumbs Up.

BR,

Marco

 

 

This works to get the values, but not in an expression. I guess it's just not possible. I'm going to have to retool the flow to use actions and save the values to an array that I can use to build the HTML table, vs. just using an expression to join those values.  You would think you could just use join on the data coming in, which you can, but you get the full items, and I just want the Value field returned. Maybe I can use some fancy string manipulation. 

Hmm, I can't do that either since you can't loop items in expressions. Oh well. Gonna use something similar to you're approach. Not exactly what I wanted to do but I think my hands are tied and I'll have to retool. Thanks for the suggestion. 

Helpful resources

Announcements
 WHAT’S NEXT AT MICROSOFT IGNITE 2022

WHAT’S NEXT AT MICROSOFT IGNITE 2022

Explore the latest innovations, learn from product experts and partners, level up your skillset, and create connections from around the world.

Register for a Free Workshop.png

Register for a Free Workshop

Learn to digitize and optimize business processes and connect all your applications to share data in real time.

September Events 2022

Check out all of these events

Attend in person or online, there are incredible conferences and events happening all throughout the month of September.

Users online (3,116)