Login Screen Need Help

Hi so for this project, i am currently working on the Login Screen. I am trying to make it so that every users that sign in will have a specific patient ID link to their username. this is to diffrientiate the data but i not so sure where to start. can anyone help?
PSC_Meter2_Test (3).aia (418.4 KB)
this is my code

Does the patient ID come with the patient, or will you have to create it ?

I suggest you handle the signup, signin and profile processes separately, making it easy for a user to signup, then require their profile information after signin (nag screen or similar)

i have to create it. so basically when the user creates a profile, a unique patient ID will be made that links to their username

Do you have a format in mind?

Can you use extensions?

This generates a unique UID, should be possible to generate without needing to check a central online register

Generate UID

just a number. so lets say when the user signs up and creates an account, it generates a random number from 2000 to 3000. for example, the number is 2456. this will then be that User's patient ID which will be specific to that User's username

Then if you have multiple users of the app, you will need a central online register of users to check the "random number" against, to avoid duplicates.

how do i start. what blocks should i use ?

Simplest approach would be to use cloudDB, and store unique IDs to a list. When a new ID is generated, call back the list and check that the ID is not in the list. If it is not in the list, then it is OK to use, add it to the list and save the list back to cloudDB. Your users will need a network connection.

I like clock1.systemtime for a lazy unique id generator