cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
kouliscon
Helper V
Helper V

auto increment an IDNr (not the SharePoilit ID)

Hello,

 

I have a column at my SharePoint Online list called IDNr and over there I would like to have a way to increment the number each time I create a new item with a powerapp flow if possible or any other way.

 

i want not to use the SharePOint ID nr as i delete some items and that will mess up the numbering.

 

thank you in advance.

 

 

1 ACCEPTED SOLUTION

Accepted Solutions
mdevaney
Super User
Super User

@kouliscon 

Let’s say you have a column called IDNr inside your list.

 

Add a field for IDNr inside the form used to create new items.  Then put this code in the Default property.

 

First(Sort(Your_List_Name, IDNR, Descending)).IDNr + 1

 

Then set the Visible property of the field to false so no one can change it.  

When the form is submitted the IDNr will increment +1

 

---
Please click "Accept as Solution" if my post answered your question so that others may find it more quickly. If you found this post helpful consider giving it a "Thumbs Up."

 

View solution in original post

4 REPLIES 4
mdevaney
Super User
Super User

@kouliscon 

Let’s say you have a column called IDNr inside your list.

 

Add a field for IDNr inside the form used to create new items.  Then put this code in the Default property.

 

First(Sort(Your_List_Name, IDNR, Descending)).IDNr + 1

 

Then set the Visible property of the field to false so no one can change it.  

When the form is submitted the IDNr will increment +1

 

---
Please click "Accept as Solution" if my post answered your question so that others may find it more quickly. If you found this post helpful consider giving it a "Thumbs Up."

 

View solution in original post

thank you @mdevaney  that worked great!!

hello @mdevaney 

 

coming back with this, I tried to implemented at a new list which I already had data and the last "IDNr" value was 220

 

when I went at the DEFAULT and I added the code: First(Sort(Invoices,IDNr, Descending)).IDNr + 1 then I noticed first at the powerapp forms the below:

 

Incremental IDNr.png

but also when I was creating an entry it was starting from value 100.

 

any idea why?

 

I also tried and is kind of working with the formula: Last(Invoices.IDNr).IDNr + 1 but that wont work when two users have open the view of the list and is not refreshed at the latest value..

 

any suggestions?

Hi boss 

This solution works perfectly with auto increment in the list but how can i add a concate to it like KIH1, KIH 2 .... 

Helpful resources

Announcements
PA_User Group Leader_768x460.jpg

Manage your user group events

Check out the News & Announcements to learn more.

secondImage

Power Apps Community Call

Please join us on Wednesday, October 20th, at 8a PDT. Come and learn from our amazing speakers!

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

Welcome Super Users.jpg

Super User Season 2

Congratulations, the new Super User Season 2 for 2021 has started!

Carousel 2021 Release Wave 2 Plan 768x460.jpg

2021 Release Wave 2 Plan

Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.

Top Solution Authors
Users online (1,294)