web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / Generating HTML table ...
Power Automate
Unanswered

Generating HTML table of after filters in apply to each

(0) ShareShare
ReportReport
Posted on by 7

I have gotten myself all confused and am hoping there is someone who can assist or point me towards the relevant information.

I have a SharePoint list that is complicated and leaves room for human error. I am trying to eliminate most of the room for error with flows that will check weekly for anomalies and can’t figure out how to get the answers I need in a format I want. I have tried looking this up and using different methods, but I can’t seem to adapt other solutions for my needs.

This is the mess I currently have in this ‘problem area’. I apologize for the redactions, it’s for work so I don’t feel comfortable sharing even the names of the columns. I have also tried many variances of this and the closest I got was an HTML table with the 7 results from Filter 1, even though I had it set to pull from Filter 2 (maybe because of my lack of understanding of apply to each?). In the end, what I want from this is a HTML table  emailed to me containing only the list items which meet the criteria of Filter 2 containing certain columns from my list.

Annotation 2023-10-05 155502.png

Annotation 2023-10-05 155502------.png

Categories:
I have the same question (0)
  • Verified answer
    Michael E. Gernaey Profile Picture
    53,335 Super User 2025 Season 2 on at

    Hey @Pita098 

     

    No worries, I can tell you are stressed. A few carriage returns go a long way in night breaking my eyes lol. It's hard to follow stuff when it's just a giant paragraph 🙂 just for future reference.

     

    Don't worry about convincing us its goofy or anything, it just distracts us from focusing on helping you 🙂 hehe.

     

    I am assuming that you want a Table, based on data from Filter2, except that you want only certain Columns, not necessarily all. 

     

    Here is what we will do

    1. don't use an append to an array and lets get rid of the loop, just take out the Apply to each and leave in your Filter.

     

    We want to use a Select, so that we can pull out only the Columns you want from the Filter2, and so that the output works in a Create HTML Table action.

     

    2. Add a Select Action right under your filter

    -in the From, use the Body (Dynamic property) from the Filter2

     

    3. Now we want to add the columns we want and this is where it can make you go "um say what Michael, are you nuts". Well yes I am but this is still how it works.

    -A filter is like an internally hidden Apply to each. 

    -So in your Map you will do this and here is my personal example for people who do this .

    --You can see in the Map, I put the String (Key) for whatever I want to call the column.

    --In the Value (this is where it gets goofy) you are going to put 

    item()?['Whatever_Your_Column_Name_Is_In_Filter2_Regardless_Of_What_You_Called_It_In_The_Select_Key_Column']
    
    So in my case for Title I have
    item()?['Title']

    And because Filter is an internal "loop" if you will, you use item just as if you literally had an Apply to each, but since your From points to a Filter body, it knows to OH grab it from that Body, without the need of a loop.

     

    After that, in your Create HTML Table, simply add the Dynamic Output property of the Select and instant table

     

    FLMike_0-1696540826270.png

     

    If this helps I'd love if you marked my answer as an answer (Resolved) and maybe also a kudo thumbs up.


    Cheers
    If you like my answer, please Mark it as Resolved, and give it a thumbs up, so it can help others
    Thank You
    Michael Gernaey MCT | MCSE | MCP | Self-Contractor| Ex-Microsoft
    https://gernaeysoftware.com
    LinkedIn: https://www.linkedin.com/in/michaelgernaey

     

  • Pita098 Profile Picture
    7 on at

    Thank you very much for the solution and the advice about lengthy posts!  I really appreciate it 🙂

     

    I had tried something similar before but couldn't get my filter to work outside of an apply to each. But - the light bulb came on after reading your solution. 

     

    For anyone who comes across this and has a similar filter, I changed my Filter 2 to: @greaterOrEquals(div(sub(ticks(utcNow()), ticks(item()?['MyColumn'])), 864000000000), 95)

     

    To get this out of am apply to each

     

     

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 522 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 364 Moderator

#3
abm abm Profile Picture

abm abm 243 Most Valuable Professional

Last 30 days Overall leaderboard