Duplicate Database Questions

Good afternoon friends,
I have some data in the database (firebase).
And when I enter a new data, digital a name, and that name already exists in the database I want an error message to appear, saying that the name entered already exists. How do I make this code?

Have something below that I’ve done but it’s not working.

Read the tags in firebase, then compare them with the new tag to insert if it exists you can choose whether to cancel or overwrite

1 Like

get list of already registered names, and then use if in list,

blocks%20(45)

in else use your next work,

1 Like

Oh man, thanks a lot.
Your answers are being very helpful. And thanks for exemplifying putting print as it is. Thanks a lot.

1 Like

welcome any time,

Samiu8336, Good Morning
I threw the blocks according to your print, but it didn’t work out. Still saving duplicate names.

see below
Screenshot_2

i think you are saving a list in a single line, then you cant compare a single text with a list, use

blocks%20(46)

I’m saving like this:
Screenshot_3

store tag as username, and then get all tags, store them in a list, then use,

Sorry for my ignorance … kkkk
But would you help me create the blocks to do this?

something like this,

blocks%20(47)

blocks%20(48)

1 Like

Friend, it worked.
Thanks

1 Like

welcome,

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.