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 / Reset Variables After ...
Power Automate
Answered

Reset Variables After Get Items ID Change

(0) ShareShare
ReportReport
Posted on by 46

This flow works as expected, but not how I need it. The Get Items is doing a match on a SharePoint ID field. I need to reset the variables to zero, when that ID field changes to a new number, which is generally somewhere between 1 and 14 rows from the Excel file, but could be more. I am stuck at detecting when the ID changes to reset the variable.

 

jmfillman_0-1664917827836.png

 

Categories:
I have the same question (0)
  • Verified answer
    Mira Ghaly Profile Picture
    11,413 Moderator on at

    @jmfillman 

    You need to keep the Current ID in a variable, every time inside your loop , compose a data operation with the ID and compare it with the variable if they match continue if they are different then reset your counter and set the Current ID variable to the ID from the compose operation.

     

  • jmfillman Profile Picture
    46 on at

    Thank you for the response. I guess my question was more so where in the flow to do that. If I add a Set Variable, after the Get Items, that creates a nested Apply to Each (see image), which I try to avoid, when possible, but even more of a problem, the nested the Apply to each loop does not actually get triggered, the first time the ID changes, which is missing an iteration, where the variable needs to be both zeroed out and a new value added to that zero.

     

    jmfillman_0-1665011585501.png

     

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 519 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 296 Moderator

#3
abm abm Profile Picture

abm abm 232 Most Valuable Professional

Last 30 days Overall leaderboard