cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
SylvieLet17
Level 8

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
Community Support Team
Community Support Team

Re: Condition: Create_HTML_table is blank

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
Community Support Team
Community Support Team

Re: Condition: Create_HTML_table is blank

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

Administrator
Administrator

Re: Condition: Create_HTML_table is blank

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
Microsoft Flow Community Manager

Helpful resources

Announcements
firstImage

Microsoft Business Applications Virtual Launch Event

Watch the event on demand for an in-depth look at the new innovations across Dynamics 365 and the Microsoft Power Platform.

firstImage

Watch Sessions On Demand!

Continue your learning in our online communities.

Power Platform 2019 Release Wave 2 Plan

Power Platform 2019 Release Wave 2 Plan

Features releasing from October 2019 through March 2020.

thirdimage

Flow Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

fifthimage

Microsoft Learn

Learn how to build the business apps that you need.

sixthImage

Power Platform World Tour

Find out where you can attend!

seventhimage

Webinars & Video Gallery

Watch & learn from the Flow Community Video Gallery!

Top Kudoed Authors
Users Online
Currently online: 318 members 4,706 guests
Please welcome our newest community members: