cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
aadilganie
Advocate III
Advocate III

Replace string retrieved from multi lookup column

Hi Everyone

 

I am trying to build a flow that creates an item for each selected item in a multi-lookup column. So if the product column has 5 items selected it will create 5 separate items. So far I have this working and i am storing the actual product being created in a normal single text field because flow doesnt support multi-lookup yet.

 

The problem is the value actually shows like this: {"Id":1,"Value":"Product1"}

Basically I would like to just keep the product which is in bold above. Any idea of how this can be done within the apply to each in flow?

 

If it helps, I am using Microsoft PowerApps SharePoint Form to capture the data.

1 ACCEPTED SOLUTION

Accepted Solutions
v-xida-msft
Community Support
Community Support

Hi @aadilganie,

 

Could you please share a screenshot of your flow's configuration?

 

I agree with @Pieter_Veenstra's thought almost, if you want to store the Lookup value (such as, Product1) into a Single line of text type column, you could get the Lookup value dynamic content directly within your flow. I have made a test on my side and my flow's configuration as below:2.JPG

The flow works successfully as below:3.JPG

 

4.JPG

 

 

If you want to get the product value which in bold above json object that you mentioned within the "Apply to each" action in flow, please take a try with the following workaround:5.JPG

 

Within "Compose" action, Inputs set to Current item dynamic content of "Apply to each" action. Within "Compose 2" action, Inputs field set to following formula:

outputs('Compose')?['Value']

Note: The ProductName column is a Lookup type column with multiple values in my SharePoint list.

 

The flow works successfully as below:6.JPG

 

More details about the operators within expression, please check the following article:

https://docs.microsoft.com/en-us/azure/logic-apps/logic-apps-workflow-definition-language#expression...

 

Best regards,

Kris

Community Support Team _ Kris Dai
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

4 REPLIES 4

you should be able to query the Value field like this

 

?["Value"]

 

A while back I wrote a post about querying json:

 

https://veenstra.me.uk/2018/02/04/microsoft-flow-http-calling-webservices-xml-vs-json/

 

You will find the query near the edn of the post.

v-xida-msft
Community Support
Community Support

Hi @aadilganie,

 

Could you please share a screenshot of your flow's configuration?

 

I agree with @Pieter_Veenstra's thought almost, if you want to store the Lookup value (such as, Product1) into a Single line of text type column, you could get the Lookup value dynamic content directly within your flow. I have made a test on my side and my flow's configuration as below:2.JPG

The flow works successfully as below:3.JPG

 

4.JPG

 

 

If you want to get the product value which in bold above json object that you mentioned within the "Apply to each" action in flow, please take a try with the following workaround:5.JPG

 

Within "Compose" action, Inputs set to Current item dynamic content of "Apply to each" action. Within "Compose 2" action, Inputs field set to following formula:

outputs('Compose')?['Value']

Note: The ProductName column is a Lookup type column with multiple values in my SharePoint list.

 

The flow works successfully as below:6.JPG

 

More details about the operators within expression, please check the following article:

https://docs.microsoft.com/en-us/azure/logic-apps/logic-apps-workflow-definition-language#expression...

 

Best regards,

Kris

Community Support Team _ Kris Dai
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

Hi

Thank you so much, gonna try this out and get back to you. My flow at the moment was actually the same as your first screenshot gonna modify to make it similar to yours..

 

Thanks again to you @v-xida-msft & @Pieter_Veenstra

Hi @v-xida-msft

You were right, turns out I didnt need to complicate things for nothing the option was there to add the product value all along. I just assumed that you couldn't use it because it was a multi-select field. It seems you can use the multi select field but you can't actually set it yet.

 

Thanks for the help!!

Helpful resources

Announcements
Process Advisor

Introducing Process Advisor

Check out the new Process Advisor community forum board!

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

V3_PVA CAmpaign Carousel.png

Community Challenge - Giveaways!

Participate in the Power Virtual Agents Community Challenge

Carousel 2021 Release Wave 2 Plan 768x460.jpg

2021 Release Wave 2 Plan

Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.

Users online (1,699)