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

Notifications

Announcements

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 674

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.

I have the same question (0)
  • Verified answer
    CharlesBrewer Profile Picture
    674 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

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 525 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 324 Moderator

#3
abm abm Profile Picture

abm abm 232 Most Valuable Professional

Last 30 days Overall leaderboard