cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
SylvieLet17
Responsive Resident
Responsive Resident

Condition: Create_HTML_table is blank

Hi all,

I'm trying to build a flow for when an email arrives in a specific folder:

Get a specific word in the subject line (varSubject), then "Get Items" from a SharePoint list with a filter where Title eq 'varSubject'.

There should only ever be one item, but sometimes the word is not in the list. 

So I want to perform a condition where if the item does not exist do X.

From the output of my Get Items action I create an HTML table. 

Then I tried with a condition @empty(body('Create_HTML_table')) but it is always returning false. 
createhtmltable.png

Any ideas what I'm doing wrong? Or if you have a better/more logical way to approach this flow, let me know!

 

Thanks,

Sylvie

1 ACCEPTED SOLUTION

Accepted Solutions
v-bacao-msft
Community Support
Community Support

Hi @SylvieLet17,

 

Do you want to set a Condition that when Get items gets an item, configure the corresponding action in IF yes. Otherwise, don't set any action in If NO?

You could use length() function to determine if the items obtained by Get items are equal to 1, and then configure the following steps.

I have made a test on my side and the flow works well. Please take a try with the following workaround.

Image reference:

21.PNG

As for what you said "a condition @empty(body('Create_HTML_table')) but it is always returning false.", because even if there is no value in the HTML table, the output value of "body('Create_HTML_table')" is also will contain tags such as "<table><tbody></tbody></table>".

So empty() will always judge that this is not empty.

Please take a try and let me know if issue still exists.

 

Best Regards,

Barry

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.

View solution in original post

2 REPLIES 2
v-bacao-msft
Community Support
Community Support

Hi @SylvieLet17,

 

Do you want to set a Condition that when Get items gets an item, configure the corresponding action in IF yes. Otherwise, don't set any action in If NO?

You could use length() function to determine if the items obtained by Get items are equal to 1, and then configure the following steps.

I have made a test on my side and the flow works well. Please take a try with the following workaround.

Image reference:

21.PNG

As for what you said "a condition @empty(body('Create_HTML_table')) but it is always returning false.", because even if there is no value in the HTML table, the output value of "body('Create_HTML_table')" is also will contain tags such as "<table><tbody></tbody></table>".

So empty() will always judge that this is not empty.

Please take a try and let me know if issue still exists.

 

Best Regards,

Barry

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.
GabrielStJohn
Community Champion
Community Champion

Hello, @SylvieLet17!

Thank you for posting on the Flow Community Forum! Have you had an opportunity to apply @v-bacao-msft‘s recommendation to adapt your Flow? If yes, and you find that solution to be satisfactory, please go ahead and click “Accept as Solution” so that this thread will be marked for other users to easily identify!

Thank you for being an active member of the Flow Community!

-Gabriel
Flow Community Manager

- Gabriel
Community Manager
Power Automate | Power Virtual Agents
Super User Program Manager



Helpful resources

Announcements
MPA Virtual Workshop Carousel 768x460.png

Register for a Free Workshop

Learn to digitize and optimize business processes and connect all your applications to share data in real time.

New Process Advisor Capabilities carousel.png

Read the blog for the latest news

Read the latest about new experiences and capabilities in the Power Automate product blog.

PA Survey Carousel Image.png

We want to hear from you!

If you are a small business ISV/Reseller, share your thoughts with our research team.

AI Builder AMA June 7th carousel (up on May 25th, take down June 8th) (1).png

'Ask Microsoft Anything' about AI Builder!

The AI Builder team invite you to ask questions and provide helpful answers at our next AMA.

Users online (1,997)