cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
aadilganie
Level 8

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
Community Support Team
Community Support Team

Re: Replace string retrieved from multi lookup column

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
Super User
Super User

Re: Replace string retrieved from multi lookup column

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.

Community Support Team
Community Support Team

Re: Replace string retrieved from multi lookup column

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

aadilganie
Level 8

Re: Replace string retrieved from multi lookup column

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

aadilganie
Level 8

Re: Replace string retrieved from multi lookup column

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
firstImage

Power Platform Online Conference

Join us for the first ever Power Platform Online Conference!

firstImage

Incoming: New and improved badges!

Look out for new contribution recognition badges coming SOON!

firstImage

New & Improved Power Automate Community Cookbook

We've updated and improved the layout and uploading format of the Power Automate Cookbook!

thirdimage

Power Automate Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

sixthImage

Power Platform World Tour

Find out where you can attend!

seventhimage

Webinars & Video Gallery

Watch & learn from the Power Automate Community Video Gallery!

Top Solution Authors
Top Kudoed Authors
Users online (4,967)