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 Apps / How to get auto-Increm...
Power Apps
Answered

How to get auto-Increment column in editable grid connected to an excel data source

(0) ShareShare
ReportReport
Posted on by 40

Hello, How can I include an auto increment  in Powerapps using an excel datasource when I update an editable grid?

Categories:
I have the same question (0)
  • leyburn19 Profile Picture
    2,157 on at
    • editable grid? never seen one.  Are you saying you want to include an incremental number when saving to a an excel table
  • Sage22 Profile Picture
    40 on at

    I do have an id column but I would like to maintain it when adding or deleting rows. Also to use it patch the updated records between the collection and data source. 

     

  • Verified answer
    v-jefferni Profile Picture
    on at

    Hi @Sage22 ,

     

    So you have an ID column in your Excel table which is data source of your App. Could you please confirm whether or not you have set to use this ID column as the key column for the Excel table? As follow:

    vjefferni_0-1631861814572.png

     

    I assume you are using the ID column as the key for your Excel table, basically there is no need to include ID in the collection when you are wanting to add new rows, if ID column is already included you could also leave it blank. The syntax of patching to the table through the collection would be:

     

    ForAll(collection, Patch(Table, Defaults(Table), {ID: First(Sort(Table, ID, Descending)).ID+1, ...}))

     

    With this formula, adding new rows into the table would generate auto-increment IDs. 

     

    When editing or deleting existing rows, you will need to use ID to look up the specific rows so IDs are needed in the collection.

     

    Hope this helps.

     

    Best regards,

    Community Support Team _ Jeffer Ni
    If this post helps, then please consider Accept it as the solution to help the other members find it.

  • Sage22 Profile Picture
    40 on at

    @v-jefferni , no. I didn’t set my ID as the key. How do you do so in PowerApps?

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 Apps

#1
WarrenBelz Profile Picture

WarrenBelz 739 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 343 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard