web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Autoincrement in Power...
Power Apps
Answered

Autoincrement in Powerapp with an excel file

(0) ShareShare
ReportReport
Posted on by Microsoft Employee

Hello,
I am developping a form via powerapps and the request are recorded in a excel file.
But I got a situation with the autoincrement.

I create a label in which I have an ID with the following formula : 

 First(Sort(Table_owssvr;ID; Descending)).ID+1  

The ID is well displayed but doesn't update on the excel file.
Here's the formula in the update field for the data card : Label2_3.Text

Categories:
I have the same question (0)
  • RandyHayes Profile Picture
    76,299 Super User 2024 Season 1 on at

    @Anonymous 

    You might consider using the value of that in your Update property:

    Value(Label2_3.Text)

    Also, if your ID is numeric, you can also consider altering your label formula to the following:

    Max(Table_owssvr; ID) + 1

    It's a little better performance and clearer to read.

     

    I hope this is helpful for you.

  • v-yuxima-msft Profile Picture
    Microsoft Employee on at

    Hi @Anonymous 

     

    Do you format your Excel as Table and then store it in one plateform for example One Drive?

    What is the data type in your excel Table?

    There is no wrong with your formula expression and it test OK on my side.

     

    Data Source: Excel Table in my OnDrive,ID(general)

    ExcelTable.PNG

    Label2.Text=First(Sort(Table1_1,ID,Descending)).ID+1

    ID_DataCard1.Update=Label2.Text  (ID:General)

    ID_DataCard1.Update=Value(Label2.Text) (ID:Number)

     

    You can also consider to use patch, 

    Patch(Table1_1,Defaults(Table1_1),{ID:Label2.Text}) (ID:General)

    Patch(Table1_1,Defaults(Table1_1),{ID:Value(Label2.Text)}) (ID:Number)

     

    ID.gif

     

    Best Regards.

    Yumia

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    I still have the same issue.
    I get no ID in the excel file which host in a onedrive.

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    I still have the same issue.
    I get no ID in the excel file which host in a onedrive.
    And the patch doesn't work.
    It gets back the error message : "You can't use this property to modify elsewhere in the application"


    @v-yuxima-msft wrote:

    Hi @Anonymous 

     

    Do you format your Excel as Table and then store it in one plateform for example One Drive?

    What is the data type in your excel Table?

    There is no wrong with your formula expression and it test OK on my side.

     

    Data Source: Excel Table in my OnDrive,ID(general)

    ExcelTable.PNG

    Label2.Text=First(Sort(Table1_1,ID,Descending)).ID+1

    ID_DataCard1.Update=Label2.Text  (ID:General)

    ID_DataCard1.Update=Value(Label2.Text) (ID:Number)

     

    You can also consider to use patch, 

    Patch(Table1_1,Defaults(Table1_1),{ID:Label2.Text}) (ID:General)

    Patch(Table1_1,Defaults(Table1_1),{ID:Value(Label2.Text)}) (ID:Number)

     

    ID.gif

     

    Best Regards.

    Yumia


     

  • RandyHayes Profile Picture
    76,299 Super User 2024 Season 1 on at

    @Anonymous 

    Are you getting any changes at all in your Excel file, or just the ID that is not working?

  • v-yuxima-msft Profile Picture
    Microsoft Employee on at

    Hi @Anonymous 

     

    Do you format your excel as Table?

    Could you please share screeshots of your example data source and  the controls and their formula expressions in your app?

     

    Best Regards.

    Yumia

  • Verified answer
    Community Power Platform Member Profile Picture
    Microsoft Employee on at

    Hi,
    I solved the issue by deleting the ID datacards I have been created more

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    Hi,
    I solved the issue by deleting the ID datacards I have been created more

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    Hi Everyone,

    I have a similar subject line but a different issue,, mine is that I'm also saving data into excel online on a column named ID and my formula to save is this:
    Value(First(Sort(Table1,ID,Descending)).ID) + 1 // ( this is without any "IF" formulas )

    but when it reaches 10.. It's stuck..

    excel onlineexcel online
    What am I doing wrong here?

    Thanks.

  • RandyHayes Profile Picture
    76,299 Super User 2024 Season 1 on at

    @Anonymous 

    Try replacing your formula with the following:

    Max(Table1, ID) + 1

    See if you experience any different results.

    Also, make sure that your maximum records option in your Advanced Settings is not set low.

     

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

Season of Sharing Community Challenge Launch!

Jump in, show your community spirit, and win prizes!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the May Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
Valantis Profile Picture

Valantis 477

#2
WarrenBelz Profile Picture

WarrenBelz 341 Most Valuable Professional

#3
11manish Profile Picture

11manish 317

Last 30 days Overall leaderboard