web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / Properly clearing a va...
Power Automate
Answered

Properly clearing a variable on a loop

(0) ShareShare
ReportReport
Posted on by 697

Hello again, Almost done with this Flow I'm working on.  I have this loop going for each branch where I work, and it builds a table from data extracted that gets emailed, like so : 

CharlesBrewer_0-1654179473243.png

However, some of those branches will have no data. So I set up an If statement so that if the tablebody is empty, it sends a different email and then ends the loop and goes back to the beginning.

CharlesBrewer_1-1654179555684.png

This was working, but the fulltable data was just getting stacked over and over on each loop, because I did not think to clear it after each loop. Oops! So I added this to the end of the loop :

CharlesBrewer_2-1654179620890.png

However, now on the 2nd iteration of the loop, the flows dies with this error :

CharlesBrewer_3-1654179658485.png

So, how do I clear out the table correctly where I will not get this error? Any help is appreciated as always, much thanks.

  • Verified answer
    CharlesBrewer Profile Picture
    697 on at

    Nevermind on this. I'm not sure the .isempty worked before and now it does not, but I realized I could just change it to 

    CharlesBrewer_0-1654185394049.png

    And now it's working properly 🙂

  • AnttiAutomate Profile Picture
    2 on at

    Hi, good job working out the solution by yourself.

     

    The problem was caused by the clear list action which changes the variable from datatable to list, which does not have the property "IsEmpty". That is why your solution worked previously but not after adding the clear list actions.

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

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the July Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Automate

#1
David_MA Profile Picture

David_MA 227 Super User 2026 Season 2

#2
11manish Profile Picture

11manish 221 Super User 2026 Season 2

#3
Mohsin Ali Profile Picture

Mohsin Ali 132

Last 30 days Overall leaderboard