Trying to make an input reject an entry that already exists

Hi there! Mostly new to bubble, but I have a fair grasp on using and editing it at the moment. I develop a roleplay community’s police database system. Currently, when a player registers their car in our system, they enter the license plate number, however duplicate license plates sometimes occur.

I am trying to find a way to make the input reject the entered plate or something similar. Currently, license plates are under a “vehicle” data type in a text field named “plate”. How can I make the input reject the entered plate if said entered plate already exists in the “plate” data section?

Thanks for any help you can offer!

make a conditional argument on the element itself, Like turn red or disable SAVE button, when conditions met

1 Like

I intend to do something like that, but my issue is I dont know how to make the system detect when the typed entry already exists in the database.

Essentially, I know hos to make it reject it, but I dont know how to make it detect that the license plate already exists on the system in order for it to reject it

Hope it helps

1 Like

That depends what “already exists” means in your context. But assuming there are one or more fields that are the “key”…

Have a condition which is a count>0 and the search being for those columns.

2 Likes

Heres an example:

Person A registers a vehicles details on the system with the license plate “12ABC345”

Person B goes to register a vehicle and tries to type the plate “12ABC345.”

I want to make it so that person B’s entry is rejected because person A has already used that plate, to prevent duplicate license plates existing

In your vehicle database make vehicle number as “Primary Key”, So no duplicates will be able to enter

https://buildingonbubble.com/block/prevent-duplicates-1574081043563x933056294657982500

Put a condition on one or more elements …

So … make the field go red border, set the button to not clickable, make some text appear.

image

There are no doubt more elegant UI solution, but that is the basis.

2 Likes

Thanks guys! I’ll give these a go and see how it goes, really appreciate the help

@NigelG @melon
Thanks so much for the help! I’ve been able to get it working!

1 Like