Feb 01, 2023 08:13 AM
Hi,
I am looking into options or workarounds to check if a value of a record exists in database before submitting a form. Is there a third party software or tool that is compatible with Airtable to do this? or is there any workaround with an automation to submit the form and check if record exists. If it does not exist, open again the form and show an error message to fill out a correct email.
I would appreciate any suggestions.
Thank you.
Solved! Go to Solution.
Feb 01, 2023 11:00 PM
Another thought - the above method is not very good if you don't want to show all of your data.
A sort of way round this is to create a prefilled form to a table that references itself. If you conditionally hide input fields depending on whether the "self reference" found anything you mimick the sort of behaviour you are after.
I built a test table with a form to demonstrate this: https://airtable.com/shrTI0mcro0PkSRQO
The issue is that you need a way to get the user to generate the bespoke urls that would pre-populate the form (https://support.airtable.com/docs/prefilling-a-form)
Here is a code-pen working example of how to do this (which links to the base above) https://codepen.io/anthony_zero/pen/XWByLqX
You can see that if you enter a reference such as "a1" that already exists in the table, the form won't show input fields. If you enter a reference that does not exist "random text here" then you are shown the input fields.
A few caveats:
Feb 01, 2023 02:28 PM
By chance I have been considering the same question today, here is a possible solution:
Create two forms, one for a dummy table that links to the table you are really interested in. The form just shows the linked record field.
The second form is the real one.
Embed both in your own simple static webpage, form 1 above form 2. Instructions to say if you can't find the record in the first section add it using the second section.
Problem is that you need the webpage to host it, and you are at risk of spamming if you cannot find a way to obscure the site. I'm considering this method myself so if anyone else can point out other drawbacks would be interested to hear!
Feb 01, 2023 11:00 PM
Another thought - the above method is not very good if you don't want to show all of your data.
A sort of way round this is to create a prefilled form to a table that references itself. If you conditionally hide input fields depending on whether the "self reference" found anything you mimick the sort of behaviour you are after.
I built a test table with a form to demonstrate this: https://airtable.com/shrTI0mcro0PkSRQO
The issue is that you need a way to get the user to generate the bespoke urls that would pre-populate the form (https://support.airtable.com/docs/prefilling-a-form)
Here is a code-pen working example of how to do this (which links to the base above) https://codepen.io/anthony_zero/pen/XWByLqX
You can see that if you enter a reference such as "a1" that already exists in the table, the form won't show input fields. If you enter a reference that does not exist "random text here" then you are shown the input fields.
A few caveats:
Feb 07, 2023 02:48 PM
Hi Anthony,
I tried and I think that's the best solution we have until now. Thanks for the suggestions.