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 II
Super User II

@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 II
Super User II

@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.

Power Query PA Forum 768x460.png

Check it out!

Did you know that you can visit the Power Query Forum in Power BI and now Power Apps

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.

R2 (Green) 768 x 460px.png

Microsoft Dynamics 365 & Power Platform User Professionals

DynamicsCon is a FREE, 4 half-day virtual learning experience for 11,000+ Microsoft Business Application users and professionals.

Users online (2,036)