cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Advocate I
Advocate I

error stopping flow when html table is blank

i want to stop my flow if the HTML table is blank.

 

i'm currently checking the length of the table and if thats 0 then it should stop, however it's not stopping. 

when i test it clearly shows the variable for length = 0 but the condition test length is not equal to 0 is still passing as true and it's proceeding.  i have tried using string and integer. both times the same. very odd. 

 

any ideas how i can stop the flow if the HTML table is effective empty?

 

thanks

len2.JPG

3 REPLIES 3
Frequent Visitor

Hi Stephen,

 

I solved this in one of my flows using the following condition:empty html.PNG

I added the condition before creating the HTML Table. In my case is an output of select, then check with: "@empty(body('Select_2'))", if YES then stops, if Not, I continue creating the HTML Table.

 

Hope this helps you.

 

Fernando

@gmfer 

 

 

Community Support
Community Support

Hi @StephenM,

 

I did a test on my side and found that both length() and empty() functions are available.

This is my test, Filter Query is set in Get items, so no item can be obtained here.

Configure the output of Get items in Select, then configure it in the Create Html table, and use length() and empty() functions to observe the results:

50.PNG

Here's the result of the run, including using the length() and empty() functions, as below:

51.PNG

Please take a try.

 

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.

Great Idea with length 🙂 @v-bacao-msft 

Helpful resources

Announcements
Microsoft Ignite

Microsoft Ignite

Join digitally, March 2–4, 2021 to explore new tech that's ready to implement. Experience the keynote in mixed reality through AltspaceVR!

New Super Users

Meet the Power Automate Super Users!

Many congratulations to the Season 1 2021 Flownaut Crew!

New Badges

New Solution Badges!

Check out our new profile badges recognizing authored solutions!

MPA Community Blog

Power Automate Community Blog

Check out the community blog page where you can find valuable learning material from community and product team members!

Users online (67,656)