Sorry for reposting this but seems to be more acti...
# help
b
Sorry for reposting this but seems to be more activity in here. Everything below has been done in JavaScript. If I have someone submitting a Username and UUID number... How do I get it to check and see if the UUID number has already been assigned to another Username? So if the UUID doesnt have a username then it will let the user submit their username, but if that UUID already has a username attached to it, then it will tell the user to try again. Any help would be greatly appreciated!
n
Hello @Ben-jam-in! This thread has been automatically created from your message in #843999948717555735 a few seconds ago. We have already mentioned the @User so that they can see your message and help you as soon as possible! Want to unsubscribe from this thread? Right-click the thread in Discord (or use the ``...`` menu) and select "Leave Thread" to unsubscribe from future updates. Want to change the title? Use the ``/title`` command! We have solved your problem? Click the button below to archive it.
b
In general UUIDs should always be unique -- that's the main reason to use them. It's statistically (nearly) impossible to get a duplicate UUID when you're generating them.
n
Ben-jam-in (2022-05-17)
b
But if you really need to check if one already exists, just query for it --
select * from table where my_uuid_field = 'some-uuid-here'
b
Thank you for that. I think using the UUID was a bad example.😁 I will be giving the user a UUID that I already have on a table in supabase. The user will be required to enter the UUID I have given them and some info... (i.e. username, email, phone number....) If the UUID exist on our supabase, then it will log their info on the row that matches the UUID. I'm trying to figure out how to: 1)display an error if the UUID doesn't match anything on our supabase... 2) display an error if it does match a UUID but info has already been submitted. I'm sorry cause I know that's really long and I'm not very good at describing what I'm trying to do.
b
All you need to do is search for an existing record with the given UUID and if you find it, return the error.