Solution to Prevent Duplicate Entry

Sorry forgot to add the iferror…fixed!

@Wiz.Wazeer Working great!

In form is it possible to stop submit button if duplicate detected?

1 Like

On the form why can’t a user be required to press cancel if duplicate entry is detected? Is this something you are trying to avoid? See, it is not an automated process. Our user decides whether to cancel or submit. On the form button itself you can now create compound actions. Why not try something like if duplicate is not empty >go back or navigate to tab.

1 Like

Timestamp Increment app is what I want. How do I get the full template and not just the demo?

1 Like

You can just copy the app.

1 Like

Actually, just use Actions.
fix-duplicate-entry

2 Likes

Welcome @noobly_channel

This is a nice one. Need to test this fix. Be back shortly.

Looks very dodgy to me. Not sure what that “delete row” action is doing in there.
The whole point of preventing duplicate entries is to avoid having to delete any rows.
Any “solution” that includes that is approaching it from the wrong direction, I’d say.

The usual way to avoid duplicates is to create a relation between the source and the target, and only allow a row to be created if that relation is empty.

2 Likes

Thank you for this. I was a bit confused myself because of the “is/not included in” condition and started questioning my own understanding of it.

While it is not standard protocol, it works. When you submit a form the row is created regardless of whether or not the condition is met. If the Name is not found in the column the new row will be generated. If the Name is found in the column then the row is still generated. With the action, however, you are then telling glide to delete that last row I just generated and then take me back to the page I was just at.

I have been testing this all morning and it works and functions without any issue. I have actually improved upon it by having glide show the form the user was inputting data into instead of the tab. That will make the experience less frustrating to them.

Here is a screenshot.

1 Like

Hmmm :thinking: your pushing me towards it. Have you tried this with multiple entries ? 2 entries for A, 2 for B, 2 for C? Do you have any relations on your sheet for identifying and filtering duplicate entries? If it is working, it’s amazing. I will test this later. :blush::+1::+1:

I’d still argue that preventing the duplicate row in the first place is a cleaner solution, and makes for a better user experience. Here’s a quick example of what I mean:

Note that:
a) The user gets immediate feedback as soon as the duplicate is detected. ie. they don’t need to submit the form, be told of the error, and then have to repeat
b) The submit button isn’t even visible while the duplicate exists, so it’s impossible to proceed without resolving that duplicate

6 Likes

That’s a nice process. I’m new, so I will have to look at how to make relationships between columns.
Does that same process work when a user is using the edit component as well?

1 Like

See I have this process on an app on this same thread. Make a copy and study it. And thank you.

Yes, it can do. Note that it requires the use of User Specific Columns. When you use User Specific Columns, any data entered is immediately written to those columns. This technique takes advantage of that fact by building a relation between the User Specific Column and the eventual target column. And this is how the duplicate is detected in real time.

Also note that the example I gave there is not using the Glide native form, but instead is a custom form built on a details layout. (You can tell this by the absence of a “Submit” link at the top-right).

2 Likes

the delete row command is not working …

Delete Row is very problematic. It can take many seconds to kick in, and sometimes does not work.

This caused me tons of problems in my app. In the end I decided to redesign my whole app to never need to delete rows. I did this by doing Set Columns with action buttons, and then clearing values when needed.

1 Like

Agreed!

1 Like

Hi, in fact, with a form this doesn’t work. And the solution of [noobly_channel] doesn’t delete row.
So, now the problem with form has not solution !

Sorry, what doesn’t work?