Only Allow Unique Entries in a Database

I am trying to achieve what seems simple, but it is eluding me at the moment.

For my prototype I am attempting to allow the user to create exercises and then string these exercises together into workouts. With that in mind i have and Exercise DB [Exercise name, 1 Rep Max] and a Workouts DC [Exercise name (linked), Number of Repetitions, Weight].

So the exercise values should only be entered once i.e. user enters Bicep Curl with a 1RM of 25, and then tries again to can only be entered once, and if the user tries again to enter Bicep Curl with a 1RM of 25 this should prevent a new entry being created in the DB.

It feels like i should be able to do this with the ‘Only when’ part of the workflow but for the life of me I cannot figure out the logical check that should be put in there to prevent a duplicate entry.

Any guidance or reference examples would be greatly appreciated.

image

You can do a search in your database with the input value as the constraint using the the contains or contains keywords operators and check the first item if empty or not; that will be your condition.

1 Like

Thank you for the reply, this would not work no matter which order i entered the values and the logic.
I ultimately went a slightly different route where i did a search for the element in the list and returned the count of values…where 0 (i.e. not in the DB before) i create the new entry, otherwise do not create the element.
image

Well that’s also valid, good luck !