cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
hyperbob0811
Helper I
Helper I

concat multiple choice look up column

I have 2 lookup fields referenced in a list, both are set to multiple choice.  I can concat both individually into a variable, BUT the result of the variable is well.... unuseable.

 

I need the actual values chosen to be pulled into the variable, instead what I get is this  

 

Field 1 (ProductLine)

{"@odata.type":"#Microsoft.Azure.Connectors.SharePoint.SPListExpandedReference","Id":1,"Value":"Wireline Flowline"};{"@odata.type":"#Microsoft.Azure.Connectors.SharePoint.SPListExpandedReference","Id":2,"Value":"Coiled Tubing and Nitrogen"};{"@odata.type":"#Microsoft.Azure.Connectors.SharePoint.SPListExpandedReference","Id":3,"Value":"Pressure Pumping and Cementing"};{"@odata.type":"#Microsoft.Azure.Connectors.SharePoint.SPListExpandedReference","Id":4,"Value":"Digital"}

 & Field 2 (Region) gives the following

"@odata.type":"#Microsoft.Azure.Connectors.SharePoint.SPListExpandedReference","Id":7,"Value":"Global"}

 

This then cannot be used in an expression  

if(and(contains(variables('Region'),'Wireline'),variables('Region'),'Global'),'Yes','No')

 

Can anyone help me here.

 

1 ACCEPTED SOLUTION

Accepted Solutions
ScottShearer
Super User III
Super User III

@hyperbob0811 

If I understand correctly, you have a SharePoint list with a lookup column and you want to reference the actual value shown rather the the ID of the list item.  You need to reference the item in Dynamic properties for the lookup column with "Value" after it.  See my example below.  My lookup column is called My Lookup.

LU4.jpgLU1.jpgLU2.jpgLU3.jpg

 

 

 

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

Scott

View solution in original post

4 REPLIES 4
ScottShearer
Super User III
Super User III

@hyperbob0811 

If I understand correctly, you have a SharePoint list with a lookup column and you want to reference the actual value shown rather the the ID of the list item.  You need to reference the item in Dynamic properties for the lookup column with "Value" after it.  See my example below.  My lookup column is called My Lookup.

LU4.jpgLU1.jpgLU2.jpgLU3.jpg

 

 

 

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

Scott

View solution in original post

Thanks, that seems to have fixed the variables, now I need to get my expression to work, as this is still coming up with a no, when it should be a yes - but at least I have something to work on.

 

@hyperbob0811 

So you have already constructed the variable as instructed by @ScottShearer 

So you can now use the below logic to check if the variable contains a specific string, so in order to use the compose expression you have to convert your variable to an array of variables by using the below expression:

split(variables('Test'),';')
Where Test is your Variable Name.
 

Then use the compose expression is below on the LHS as below:

contains(variables('StringArray'),'X')
Where stringarray is a new variable you have initialized
 

Mira_Ghaly_1-1599624458792.png

 

 

If this post helps you with your problem, please mark your as Accepted solution.If you like my response, please give it a Thumbs Up.

Blog: here

your solution worked and with the and expression using if, contains with and I also managed to get the whoile thing working.

 

expression I used was 

 

if(and(contains(variables('Variable name here'),'String to find here'),contains(variables('variable name here'),'String to find here')),'Yes','No')

Helpful resources

Announcements
MPA User Group

Welcome to the User Group Public Preview

Check out new user group experience and if you are a leader please create your group

MBAS on Demand

Microsoft Business Applications Summit sessions

On-demand access to all the great content presented by the product teams and community members! #MSBizAppsSummit #CommunityRocks

MBAS Attendee Badge

Claim Your Badge & Digital Swag!

Check out how to claim yours today!

secondImage

Are Your Ready?

Test your skills now with the Cloud Skill Challenge.

Top Solution Authors
Users online (46,215)