cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Sephiel
Helper II
Helper II

converting sharepoint document library lookup column output to value only

Hey all,

 

I'm working on a Flow to generate a weekly email that lists new files uploaded to a SharePoint document library in the past week. I was able to get an email output with the proper information using a Filter Query (thanks @ScottShearer!), send it to a select filter, output to an HTML table and so on.

 

Annotation 2020-06-24 140516.jpg

 

The trouble I'm running into is that the "All Products" and "Crop" columns are multi-select lookup columns, so the output contains much more object information that I'd like to filter out. I have seen an example to use a Compose step and include ?['Value'] in the expression, but I get the error that it needs to be an integer. 

 

Annotation 2020-06-24 140225.jpg

So here, my target output is a table listing just "Fertilizer", "Product 2", etc. Doesn't much matter if they are in separate lines or separated by commas. The table output I'm going for is:

 

TitleProductCrop
Title 1

Fertilizer

Product 2

Product 3

Crop 1
Title 2

Product 1

Product 2

Crop 1

Crop 2

Crop 3

 

I'm trying to accomplish something very similar to this:

https://powerusers.microsoft.com/t5/Building-Flows/Replace-string-retrieved-from-multi-lookup-column...

 

Thanks for any help!!

5 REPLIES 5
abm
Super User III
Super User III

Hi @Sephiel 

 

You won't be able to convert into HTML using the select filter because you have multiple product values in an array.  You need to iterate the products in another loop. Then once you have all the information you may need to try using the HTML tags (using <tr> <td> tags)  to construct using append strings or an array to build the report you need.

 

Thanks



Did I answer your question? Mark my post as a solution!

If you liked my response, please consider giving it a thumbs up


Proud to be a Flownaut!

Learn more from my blogPower Automate Video Tutorials
v-bacao-msft
Community Support
Community Support

 

Hi @Sephiel ,

 

If so, using Select action cannot achieve your needs.

You can consider the following configuration:

Spoiler
121.PNG122.PNG123.PNG

 

Best Regards,

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

Thanks! That method is giving me the intended results as long as I set each string variable to null at the end of the highest "Apply to Each" loop.

 

Annotation 2020-07-01 143020-2.jpg

Now the only challenge I am running into is where exactly using HTML tags will work to get the multi-level results onto separate lines - if I include them in the "append to string variable" steps (just adding <br> to the end of the expression,) it logically does read it as part of the string and not as an HTML tag. Is there a way that I can change the array to read the HTML tags as I'm hoping? Thanks!

Annotation 2020-07-01 145104.jpg

@abm @v-bacao-msft 

 

Hi @Sephiel ,

 

You can try to add a new line in the Value of Append to string variable.

 

After you configure Dynamic content in Value, click "Enter" to add a new line.

 

Best Regards,

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

Hey @v-bacao-msft,

 

I am just stuck scratching my head here. I'd seen other examples of putting a new line in the inputs for the variables, but in my case it only adds a space instead of a new line.

 

But it seems that's the least of my concerns - I cannot get any email output that changes the table layout from my Create HTML Table step. I have tried adding the CSS table styling to the body of the email message. I've tried including it in a Compose step as in this tutorial: https://ryanmaclean365.com/2020/01/29/power-automate-html-table-styling/.

I've tried to use Compose to replace the styling via this tutorial: https://www.sharepointsiren.com/2019/07/formatting-html-tables-in-flow/. I've tried different versions of the email client and nothing touches the look of the table. I have a similar flow using the output of an HTML table and the V2 email client and the table is formatted exactly as intended. I feel like I'm doing the exact same thing, but this time the table will not change formatting no matter what I try. Any ideas?

Helpful resources

Announcements
MPA_User Group Leader_768x460.jpg

Manage your user group events

Check out the News & Announcements to learn more.

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.

R2 (Green) 768 x 460px.png

Microsoft Dynamics 365 & Power Platform User Professionals

DynamicsCon is a FREE, 4 half-day virtual learning experience for 11,000+ Microsoft Business Application users and professionals.

Top Solution Authors
Users online (1,506)