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.
Here's the error message I receive:
I've also tried length(body('Select_Inventory_Table_Fields')?['Branch Name']), but that also doesn't seem to work.
Thank you!
@v-alzhan-msft Thank you so much!! This one works!
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.
@Anonymous
Try using:
empty(outputs('Select_Inventory_Table_Fields'))
is equal to false
**Use the expression false (see below)**
** 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. **
Hi!
It looks like that expression is giving me a different type of error:
I feel like we're getting closer! Thank you for your help! Let me know if you think of anything else to try!
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.
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:
Here's the result of the conditional + email:
Just to check (for science!), I set the conditional to true, and it sent all the emails, even those with empty tables.
Hi @Anonymous
Can you try using empty() expression instead?
Try:
empty(outputs('Select_Inventory_Table_Fields')?['Branch Name'])
is equal to
false
Thanks so much for taking the time to reply! Here's the error message I received for the second expression.
Hello @Anonymous
What is your error when you use the second expression you showed?
Michael E. Gernaey
497
Super User 2025 Season 2
David_MA
436
Super User 2025 Season 2
Riyaz_riz11
244
Super User 2025 Season 2