I’ve been using a custom formula (MaximumID+1) to automatically assign sequential ID numbers to new users. This happens at the moment the new user creates his/her account.
But I have been told on this forum that this creates a risk of duplicate numbers, because it’s very possible that 2 users will create their accounts at exactly the same time. This will be especially true if hundreds of new users sign up daily.
But I need simple, sequential ID numbers. So I can’t use any of the random generator strategies that have been suggested.
So here’s my question: I really don’t need that number to be assigned instantly. Is there a way to add a time delay to the process, allowing numbers to be assigned minutes, hours, or even days after the user record was created? I don’t know if the Adalo database allows for any kind of scripting, but I think this is what I’m looking for. The script would autofill the MemberID column with sequential numbers (exactly like you can do when you drag down a column in Excel), stopping before the very end of the user list. Maybe only numbering records that were created 5 minutes before current time.
It doesn’t have to be a script. Just some kind of time delay to avoid duplicate numbers, but allowing each new user to have his or her number assigned sometime within the same day.
Any ideas out there?
You can get the internal record ID by creating the user via API instead of the “Sign up” action.
On your login screen, have an input for email, an input for password, and a button.
On the button, create a custom action to use the Adalo API to create a new user. Then another action following to log in the new user. 3rd, an update logged-in user action the new user with the record ID result from the initial API call. The last action on the button is to link to the next screen.
This method is pretty quick too.
If I understand correctly, this will use the internal record ID for the User ID, correct?
Here is my problem: Quite a few of my customers are elderly and will never use the app. Some will, some won’t. Some of the others are homeless and don’t own phones. But they will all use their MemberID number to access services in my store.
So I have printed physical Membership ID cards, with sequential ID numbers (1,2,3, etc). Everybody gets a physical ID card. Some people will show their digital ID card (the profile screen on their app) and others will show their physical ID card.
I can’t afford to buy a ID card printer that will make one card as soon as a member signs up. So I print the cards in bulk, sequentially numbered. They don’t have names, only ID numbers.
This is why I need to assign ID numbers in sequential order. When a new member joins, I will physically hand him the next card in my stack. That number will correspond to his Member ID number in the database and on the app, but I can’t know who will use the app and who will use a physical ID card.
I use this formula when the user registers to assign them an ID:
Current time is already a unique value as it changes every second. You could have the case that two or more users click on register at the exact second. That’s why I added the random function between 1 and 1,000.
This has been working on my app with no issues.
I hope that helps.
This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.