Find duplicate email on collection item entry

Hey,

I have an onboarding flow where I will let let an agency add their clients. I would like to show them that it’s not possible to enter a certain email if it already exists.

My problem is, is that I am doing this entry with a collection, this means, the row/value only gets added after submit.

Is there a way to maybe trigger an action on submit to search if that email already exists and if yes, not submitting the form?

I tried adding a relation to the email and then a rollup to cound how many times that email exists, but I’m stuck there.

thank you so much :slight_smile:

No, that’s not possible.

That’s the idea, but you need to use it with a Custom Form.

1 Like

Yes, I already have an onboarding helper table, but an agency can add multiple clients, so how can I add multiple users to that helper table?

I have 1 row in the helper table and all user specific, so not really adding more rows.

Can I add multiple values in one cell and then do the rollup with relation to the users table?

The specific section of the video that I linked to talks about how to create a custom form.

Yes, but does that mean I have to create another helper table, next to the onboarding helper table?

Not necessarily.
You just need to switch from using a native form to using a custom form. Where you collect the input values doesn’t matter. The main point is, when you use a custom form the input values will be written to user specific columns, so you can use them to create a relation to existing data, and then use the state of that relation to determine whether or not a duplicate is being created. You can then warn the user and stop them from submitting the form.

Yes, that works, however I have:

1 agency → multiple clients

In the onboarding flow the agency will add multiple clients. What is the easiest way to save the multiple creators in the helper table, if I have one row in the helper table with all user specific columns.

Can I add an array or a list to one column/cell and populate it with more and more emails of the different clients added?

How do they do it now? Presumably one by one?
Is there any reason why they can’t continue to do that?
Adding them as a batch is possible, but would require using the API.