Using MAX() + 1 for ID number causes row overwrite

Hello everyone,

I have a table called Quotes and 4 Sales reps who each can only see their own quotes. This table has a key column called [Quote ID] with initial value of MAX(Quotes[Quote ID])+1. Problem is that in this formula MAX expression applies only to the rows that are visible to each user and this obliviously causes insertion of rows with same key to the database which leads to new rows overwrite the old ones with the same key, [Quote ID].

I use following security filter to restrict access of each sales rep to their own records:
OR(USEREMAIL()=[Sales rep],IN(USEREMAIL(),SELECT(User Management[Email],[Role]=Admin)))

I'm seeking suggestions on how to generate IDs that are both incremented by 1 and unique to each user. Any insights or alternative approaches would be greatly appreciated!

Solved Solved
0 2 50
1 ACCEPTED SOLUTION

Hello there,

Sequential ID's are a bad practice in appsheet, you can read an in depth explanation of why here:

https://support.google.com/appsheet/answer/10106361?hl=en

I suggest you stick to a classic UNIQUEID() hidden column for your KEY column for that table.

View solution in original post

2 REPLIES 2

Hello there,

Sequential ID's are a bad practice in appsheet, you can read an in depth explanation of why here:

https://support.google.com/appsheet/answer/10106361?hl=en

I suggest you stick to a classic UNIQUEID() hidden column for your KEY column for that table.

Yes, I figured. Thanks for sharing the article.

Top Labels in this Space