Skip to main content
Community site session details

Community site session details

Session Id : TH1vOGTpJHjVcMpW+vyuZD
Power Automate - Building Flows
Answered

Configuring Condition to check if HTML table is empty before sending email

Like (0) ShareShare
ReportReport
Posted on 11 Aug 2020 21:43:30 by

Hi everyone!

 

I'm almost finished with a flow that will send an HTML table in the body of an email, but I'd like to check if the HTML table is empty before sending the table. I saw other solutions that recommended checking the length of one of the fields in the table to make sure it's not empty, but I'm running into a wall. Can you help me configure this Condition? 

 

For clarification, there are two tables sources - one with data and one with email addresses. Both contain the field Branch Name. 

Conditional - Check if table is empty.PNG

Here's the error message I receive: 

Conditional - Error Message.PNG

 

I've also tried length(body('Select_Inventory_Table_Fields')?['Branch Name']), but that also doesn't seem to work. 

 

Thank you! 

 

  • Community Power Platform Member Profile Picture
    on 13 Aug 2020 at 23:36:16
    Re: Configuring Condition to check if HTML table is empty before sending email

    @v-alzhan-msft Thank you so much!! This one works! 

  • Verified answer
    v-alzhan-msft Profile Picture
    on 13 Aug 2020 at 02:00:47
    Re: Configuring Condition to check if HTML table is empty before sending email

    Hi @Anonymous ,

     

    The expression should work:

    length(body('Select_Inventory_Table_Fields'))

     

    Best Regards,

    Alice

     

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

  • Jcook Profile Picture
    7,779 Most Valuable Professional on 12 Aug 2020 at 17:50:11
    Re: Configuring Condition to check if HTML table is empty before sending email

    @Anonymous 

     

    Try using:

     

    empty(outputs('Select_Inventory_Table_Fields'))

     

    is equal to false

    **Use the expression false (see below)**

     

    Jcook_0-1597254593228.png

     

     

    ** Update -- Please note that you may want to move your send email action to the if no branch for my solution above. For context the empty expression will return true if the value being passed is empty. **

     

  • Community Power Platform Member Profile Picture
    on 12 Aug 2020 at 16:00:26
    Re: Configuring Condition to check if HTML table is empty before sending email

    Hi! 

     

    It looks like that expression is giving me a different type of error: 

    Conditional - Error Message3.PNG

    I feel like we're getting closer! Thank you for your help! Let me know if you think of anything else to try! 

  • v-alzhan-msft Profile Picture
    on 12 Aug 2020 at 01:52:18
    Re: Configuring Condition to check if HTML table is empty before sending email

    Hi @Anonymous ,

     

    Take a try with expression:

    length(outputs('Select_Inventory_Table_Fields'))

    check if the expression is greater that 0.

     

    Best Regards,

    Alice

     

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

     

  • Community Power Platform Member Profile Picture
    on 11 Aug 2020 at 23:22:49
    Re: Configuring Condition to check if HTML table is empty before sending email

    Thank you, I really appreciate you helping me! I tried it, but for some reason it evaluated as false.

     

    Here's a screenshot of the result of Select Inventory Table Fields where Branch Name is not empty:

    Select Inventory Table Fields.PNG

     

    Here's the result of the conditional + email: 

    Conditional - Not Fulfilled.PNG

     

    Just to check (for science!), I set the conditional to true, and it sent all the emails, even those with empty tables. 

  • Jcook Profile Picture
    7,779 Most Valuable Professional on 11 Aug 2020 at 23:00:29
    Re: Configuring Condition to check if HTML table is empty before sending email

    Hi @Anonymous 

     

    Can you try using empty() expression instead?

     

    Try:

    empty(outputs('Select_Inventory_Table_Fields')?['Branch Name'])

    is equal to

    false

  • Community Power Platform Member Profile Picture
    on 11 Aug 2020 at 22:18:54
    Re: Configuring Condition to check if HTML table is empty before sending email

    Thanks so much for taking the time to reply! Here's the error message I received for the second expression. 

    Conditional - Error Message2.PNG

  • Jcook Profile Picture
    7,779 Most Valuable Professional on 11 Aug 2020 at 22:01:16
    Re: Configuring Condition to check if HTML table is empty before sending email

    Hello @Anonymous 

     

    What is your error when you use the second expression you showed?

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

Announcing our 2025 Season 2 Super Users!

A new season of Super Users has arrived, and we are so grateful for…

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!

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