Preventing creating a duplicate

I have a data collection of stores. There’s a function to create a number for that store, (another store can have the same number but only if it’s created for thy store as well). When creating a number, the “save” button needs to see if the number typed in the input field is already in the database for that specific store it’s being made for. And if it already exists it does not re create that number. So one store can’t have 5%, 5%, 10%, 15%, etc. the numbers and stores are their own collection and have a relationship of one store to many numbers / many numbers to one store.


Hey there @Zwood

Here’s how you do it. I have to walk step by step, I know you’ve already got it all in place but it’s just better for me to explain it thoroughly.

  1. Add an input, a button, and a text component. Input on top, button below the input, and text component below the button.
  2. Rename input to “Tip Input” and set as a Number input.
  3. Set the button visibility to “Sometimes Visible > if Current Store > Tips % COUNT > is equal to > 0” and add a custom filter where “Tip % > is equal to > Tip Input”.
  4. On the text component, type “This % already exists” and set the visibility to "“Sometimes Visible > if Current Store > Tips COUNT > is NOT equal to > 0” and add a custom filter where “Tip % > is equal to > Tip Input”.
  5. Group the button and text component together and set the visibility of the group to “Sometimes Visible > if Tip Input > is NOT equal to > empty”.

What this will do is this will display the button if the % does not exist and it will display the text if the % does already exist.

Button settings: screenshot-app.adalo.com-2022.03.18-14_09_47 - Nimbus Capture
Text settings: screenshot-app.adalo.com-2022.03.18-14_10_24 - Nimbus Capture
Group settings: screenshot-app.adalo.com-2022.03.18-14_11_00 - Nimbus Capture

1 Like

This works! Thank you!!

1 Like