cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
ElyasAhmed
Frequent Visitor

Add serial autonumber even after existing record is deleted

I have an entity "Questions" in which there is an S.no Column. I used the auto number attribute to assign a value to the S.no column in this format: "QNo" + number with seed value 1000. I have 14 questions in the table(the 14th column has a value QNo1013). After creating a question in the form and deleting it, when I'm trying to create a new question I am getting a value of QNo1015 instead of QNo1014. Is there any way to retain the order of the column values in the auto number variable?

1 ACCEPTED SOLUTION

Accepted Solutions
Drrickryp
Super User
Super User

@ElyasAhmed 

Autonumber its following a cardinal rule that a primary key is not reused once it is deleted. It makes sense when the key is used to connect to another table to establish a relationship. That being said, there are ways to fill in missing numbers using Sequence() or First(Sort(datasource, number, Descending)).number+1

View solution in original post

2 REPLIES 2
Drrickryp
Super User
Super User

@ElyasAhmed 

Autonumber its following a cardinal rule that a primary key is not reused once it is deleted. It makes sense when the key is used to connect to another table to establish a relationship. That being said, there are ways to fill in missing numbers using Sequence() or First(Sort(datasource, number, Descending)).number+1

View solution in original post

Thanks a lot @Drrickryp !!

 

Helpful resources

Announcements
PA_User Group Leader_768x460.jpg

Manage your user group events

Check out the News & Announcements to learn more.

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
Top Kudoed Authors
Users online (993)