Skip to main content

Notifications

Power Automate - Using Flows
Unanswered

Add a row in Excel increment item number

(0) ShareShare
ReportReport
Posted on by 8

Hello - I have a similar situation as https://powerusers.microsoft.com/t5/General-Flow-Discussion/Auto-Increment-ID-number-in-Form-Responses-Tab-Excel-sheet/m-p/233774 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

  • v-bacao-msft Profile Picture
    v-bacao-msft on at
    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,

  • NeilP Profile Picture
    NeilP 8 on at
    Re: Add a row in Excel increment item number

    flow result.jpg

  • NeilP Profile Picture
    NeilP 8 on at
    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
  • v-bacao-msft Profile Picture
    v-bacao-msft on at
    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,

  • NeilP Profile Picture
    NeilP 8 on at
    Re: Add a row in Excel increment item number

    Capture.JPG@Marty3012 @Anonymous 

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

Microsoft Kickstarter Events…

Register for Microsoft Kickstarter Events…

Announcing Our 2025 Season 1 Super Users!

A new season of Super Users has arrived, and we are so grateful for the daily…

Announcing Forum Attachment Improvements!

We're excited to announce that attachments for replies in forums and improved…

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 145,526

#2
RandyHayes Profile Picture

RandyHayes 76,287

#3
Pstork1 Profile Picture

Pstork1 64,907

Leaderboard

Featured topics

Restore a deleted flow