Skip to main content
Community site session details

Community site session details

Session Id : WQ1CKKKlR3zRBYMtdpL/S2
Power Automate - Building Flows
Answered

Create a HTML table from an Excel table after an Apply to each condition

Like (0) ShareShare
ReportReport
Posted on 24 Oct 2023 11:41:52 by 34

Hey Guys,

 

I am trying to create a HTML table based on a single row from an excel table.

 

I am currently using the following:
1. List Rows Present in a Table

2. Apply to Each

3. Condition: If 'Generate Statement' = True

     If Yes: Create HTML Table and then send as an email.

 

The excel table contains approx 40 rows. It is correctly identifying the one test row I want to include in the HTML table but it is duplicating it as many times as there are rows.

 

I just want the single applicable row to be included in the HTML table

 

Any help would be appreciated

 

Ricardinh0_0-1698147537338.png

 

 

  • Ricardinh0 Profile Picture
    34 on 24 Oct 2023 at 13:30:59
    Re: Create a HTML table from an Excel table after an Apply to each condition

    Thank you. It wasn't.

    I changed the column in Excel from a TRUE/FALSE to a "Y"/"N" and it seemed to do the trick.

    Thank you for your help. 
    I have another query regarding how to get the email address from the row in question but I will post as a new question.

     

    Thanks again.

    Rich

  • ManishSolanki Profile Picture
    15,085 Super User 2025 Season 2 on 24 Oct 2023 at 12:55:55
    Re: Create a HTML table from an Excel table after an Apply to each condition

    Pls inspect if filter array is returning records from the last run flow instance.

     

    Thanks

  • Ricardinh0 Profile Picture
    34 on 24 Oct 2023 at 12:52:12
    Re: Create a HTML table from an Excel table after an Apply to each condition

    Thank you again for your response.

     

    I followed the instruction but unfortunately the email returns with headers but no values.

     

    Ricardinh0_0-1698151780345.png

    Ricardinh0_1-1698151906804.png

     

     

  • Verified answer
    ManishSolanki Profile Picture
    15,085 Super User 2025 Season 2 on 24 Oct 2023 at 12:38:15
    Re: Create a HTML table from an Excel table after an Apply to each condition

    Hi @Ricardinh0 

     

    We need to get rid of "Apply to each" action which causes the multiple emails to trigger.

     

    Pls modify the flow as per the below instructions:

    1. Delete all header & values rows from the "create html table" action.

    2. Drag it out of apply to each action and place it just after the "Filter array" action.

    3. Now, add the expressions for each columns. I have shown the example of 'Name' column:

    ManishSolanki_0-1698150842447.png

    item()?['Name']

    Similarly, set the expression for all the required columns. It follows the following pattern:

    item()?['<<Column Name in Table>>']

     

    4. Drag out "Send an email" action out of the apply to each block and place it just after the "Create html table" action:

    5. Delete the "Apply to each" action.

     

    Pls retest the flow after making the required changes.

     

    If this helps & solves your problem, please remember to give a 👍 and accept my solution as it will help others in the future.

     

    Thanks

     

  • Ricardinh0 Profile Picture
    34 on 24 Oct 2023 at 12:24:34
    Re: Create a HTML table from an Excel table after an Apply to each condition

    Thank you for your response, but this resulted in 45 emails being sent.

    I think the issue is that I need Custom Columns, when I populate the columns it creates an apply to each step which resulted in multiple emails being sent.

     

    The emails were all blank as well.

    Ricardinh0_0-1698150257071.png

     

     

  • ManishSolanki Profile Picture
    15,085 Super User 2025 Season 2 on 24 Oct 2023 at 12:16:07
    Re: Create a HTML table from an Excel table after an Apply to each condition

    Hi @Ricardinh0 

     

    You could use "Filter array" action just after the "List rows present in a table" action for filtering the records. After this, you could directly pass the output body of filter action to Create HTML table action. This way we will avoid the apply to each loop. Here is an example:

    ManishSolanki_0-1698149529798.png

    To enter the filter query, click "Edit in advanced mode" bottom on the bottom of the action. Filter query used in above screenshot:

    @equals(item()?['Generate Statement'], True)

    You could create the html table using the body of filter array action:

    ManishSolanki_1-1698149703179.png

     

    If this helps & solves your problem, please remember to give a 👍 and accept my solution as it will help others in the future.

     

    Thanks

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

Paul Stork – Community Spotlight

We are honored to recognize Paul Stork as our July 2025 Community…

Congratulations to the June Top 10 Community Leaders!

These are the community rock stars!

Announcing the Engage with the Community forum!

This forum is your space to connect, share, and grow!

Leaderboard > Power Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 497 Super User 2025 Season 2

#2
David_MA Profile Picture

David_MA 436 Super User 2025 Season 2

#3
Riyaz_riz11 Profile Picture

Riyaz_riz11 244 Super User 2025 Season 2

Loading complete