cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
NeilP
Level: Powered On

Add a row in Excel increment item number

Hello - I have a similar situation as https://powerusers.microsoft.com/t5/General-Flow-Discussion/Auto-Increment-ID-number-in-Form-Respons... and https://powerusers.microsoft.com/t5/Creating-Apps/Numbering-rows-in-the-table/m-p/203589

 

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?

 

Thanks!

Neil

5 REPLIES 5
NeilP
Level: Powered On

Re: Add a row in Excel increment item number

Community Support Team
Community Support Team

Re: Add a row in Excel increment item number

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:

13.PNG

 

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.
NeilP
Level: Powered On

Re: Add a row in Excel increment item number

@v-bacao-msft 

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.
 
Neil
Highlighted
NeilP
Level: Powered On

Re: Add a row in Excel increment item number

flow result.jpg

Community Support Team
Community Support Team

Re: Add a row in Excel increment item number

Hi @NeilP ,

 

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

 

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.

Helpful resources

Announcements
thirdimage

Power Automate Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

firstImage

Incoming: New and improved badges!

We've given our badges an overhaul and also added some brand new ones!

fifthimage

Microsoft Learn

Learn how to build the business apps that you need.

sixthImage

Power Platform World Tour

Find out where you can attend!

seventhimage

Webinars & Video Gallery

Watch & learn from the Power Automate Community Video Gallery!

Top Kudoed Authors (Last 30 Days)
Users online (5,046)