Showing results for 
Search instead for 
Did you mean: 
Regular Visitor

Add a row in Excel increment item number

Hello - I have a similar situation as and


I would like to number the rows as they are added using Flow. However, I'm not sure about how to structure the expression that would get this done. Here's what I have so far:

I would like the "Camper" column to be where the item number goes. It would be incremental: 1, 2, 3 based on where the flow last ended. So row 84-86 (which came in by the Flow) should be numbered 82-84 respectively:

Any suggestions on an expression that would work or a way of getting this item numbering done?




Regular Visitor

Hi @NeilP ,


Could you share screenshots of Flow's current configuration?

I am not sure where you got the data and inserted them into the Excel table.


If you are inserting the submitted data from MS Forms into the Excel table, it seems that you have a solution in the Thread you provided.

List of response notification Response Id will record the order of submissions.


If you want to automatically add the item number when inserting data into an Excel table that already has records, we could use the variable to get the current max item number, and then add 1 to generate a new item number.

For example, my field name is Item Number, please refer to the following method to get the max item number.


Image reference:



Please take a try.


Best Regards,

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.


Thanks Barry - I think we're close! The data is coming in from an online form service called Cognito Forms. They don't have a way on their end to number the list, so doing it like you suggested within the Flow I think is the way to go. When I put it together and ran a test this was my result:

InvalidTemplate. Unable to process template language expressions in action 'Append_to_array_variable' inputs at line '1' and column '2494': 'The template language function 'int' was invoked with a parameter that is not valid. The value cannot be converted to the target type.'
This was for records/rows 86, and 87 which were the two rows added at the start of the flow and so didn't have numbers assigned to them yet. Rows 1-85 picked up the integer number already in the row no problem. The flow didn't continue to the last Compose step. I think we need to find a way to increment the number and assign it to these last two spots in the array? Really appreciate your help, this is my first time using Flow so I'm really a fish out of water.
Regular Visitor

flow result.jpg

Hi @NeilP ,


I think you can consider manually filling the remaining two item numbers in the Excel table.



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.

Helpful resources

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 (38,453)