Skip to main content

Notifications

Community site session details

Community site session details

Session Id :
Power Automate - General Discussion
Suggested answer

auto increment where another field matches

(0) ShareShare
ReportReport
Posted on by
Essentially im trying to replicate this excel formula in powerautomate =COUNTIF($A$2:A2,A2)
 
it check for a duplicate value in A2 and increments the number if it does
 
type ID Image ID
1 1
1 2
1 3
3 1
Categories:
  • Suggested answer
    Michael E. Gernaey Profile Picture
    44,271 Super User 2025 Season 1 on at
    auto increment where another field matches
     
    So essentially you have data, you want to point to a specific Row in your data, compare that against some particular data value, then in the current Row, update its value specifically.
     
    It is possible to do this, and David provided some guidance, but what I will add is, what you are missing to give us is the Context of when you plan and need this.
     
    What I mean is.
    Imagine you have an Excel sheet that you want to populate to SharePoint.
    You grab the data and before you insert the row into SharePoint, that's the point where you want to do this check, well then my answer would be different, than if you said you wanted to add it to an Array.

    The point being is, you can absolutely grab data from somewhere and have it return an array of data items (rows)
    You can then loop through that to impact another datasource (or the same) and do the calculation you want and by calculation I simply mean do the check of the value in whatever ROW is constant (you define) compared to the current row and update it WITHIN the action that will insert the data, NOT in the actual Array of data returned from Excel.
     
    Now, let's pretend instead, that you pulled Data from Excel.
    You wanted to create an Array of data to Email someone and you needed the functionality above.
    You could use the Select action, to pull ONLY the Columns from the Data you pulled from excel, you could then add an additional Column Named (Image Id) and in there put an expression that would calculate what value to put there.
    You could then use the Create HTML Table, to create a Table that looks like the above
    Then the Send Email Action to email it
     
    So totally possible, but depends on your scenario, how to implement it.
     
    Cheers,
     
    If this answers your question Please mark the answer as such and maybe a like
    Thanks!
  • David_MA Profile Picture
    11,744 Super User 2025 Season 1 on at
    auto increment where another field matches
    I don't think I really understand your requirement, but do this to see if this is what you are asking:
    • Create an integer variable and set the default value to the initial value you want to increment.
    • Then in your flow where you need to increment, insert an Increment variable action.
      • Point it to the variable in the above step.
      • Increment it by your desired amount.

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

Paul Stork – Community Spotlight

We are honored to recognize Paul Stork as our July 2025 Community…

Congratulations to the June Top 10 Community Leaders!

These are the community rock stars!

Announcing the Engage with the Community forum!

This forum is your space to connect, share, and grow!

Leaderboard > Power Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 497 Super User 2025 Season 1

#2
David_MA Profile Picture

David_MA 436 Super User 2025 Season 1

#3
Riyaz_riz11 Profile Picture

Riyaz_riz11 244 Super User 2025 Season 1