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

Welcome to the User Group Public Preview

Check out new user group experience and if you are a leader please create your group

Power Apps Community Call

Monthly Power Apps Community Call

Did you miss the call?? Check out the Power Apps Community Call here!

secondImage

Experience what’s next for Power Apps

See the latest Power Apps innovations, updates, and demos from the Microsoft Business Applications Launch Event.

Power Platform ISV STudio

Power Platform ISV Studio

ISV Studio is the go-to Power Platform destination for ISV’s to monitor & manage applications post-AppSource publish.

Top Solution Authors
Top Kudoed Authors
Users online (41,329)