Anyway to make sure a relation field does not scan itself?

Hello. I am trying to create a username checker that will make sure 2 users cant have the same “username” (text column). I though of just using a relation column to check all "username"s in users, than a if, then column to say ‘taken’ if the realtion column was NOT empty and to say ‘unique’ if empty. This worked, until a user ented a username. The relation scanned all "username"s in the username column and found that same user, so the if, then comand said ‘taken’
For eg, ‘Greg’ makes his username ‘gregtheguy’ but the if, than command said it was taken as the relation scanned ofr usernames and found ‘Greg’ with the same username ‘gregtheguy’ even though he is the SAME PERSON!!! :exploding_head:
Please could anyone let me know how i could do something bout this like “fitering” the relation column for the not the same user of something…

Make it a multiple relation, and then use a rollup to get a count. If the count is greater than one, then you have a duplicate.

3 Likes

yes, while this does work, what i was doing is i had a text component that would display if rollup is more that 1, that says “this username is taken” when someone trys a taken one on the edit profile screen. but the problem now is that it deosnt update live, so if Greg had the username “Hello” and then Bob comes along and edits profile and trys to enter the username “Hello” as well IT SHOULD say “this username is taken” but it says nothing. than when bob comes back it will show the “this username is taken” text. is there anyway else to hold the user from submiting edit profile chnage until their username is unique?

To do that you need to use a custom form.

1 Like