May 04, 2021 03:08 PM
I need read-only users to be able to click a button and delete a record. I am just about to start learning JS (how many people are saying that now Airtable Scripting exists!) but currently have no coding knowledge!
Can anyone help with a script I can run on a button being clicked to delete the relevant record? Thanks in advance!
May 04, 2021 03:14 PM
Writing that script would be easy except I’m pretty sure read-only users wouldn’t be able to use it. Either a user can edit/delete a record by any means or they can’t.
May 04, 2021 03:50 PM
I was worried about that. Ok, will just have to wait till our Stacker solution is all setup. Never mind!
Thanks for your response Kamille.
May 04, 2021 03:51 PM
Any chance you could provide me the script so I can test to confirm?
May 04, 2021 03:55 PM
Straight from the Scripting documentation: table.deleteRecordAsync(recordId)
May 04, 2021 05:17 PM
You could have a button that opens an Airtable form prefilled with the record id of the record to be deleted. The user submits the form, then have an automation script trigger do the actual deletion.
May 04, 2021 05:26 PM
That’s definitely one way to do it. Very, very clever.
May 04, 2021 05:36 PM
Thanks Kuovonne. It’s a great workaround. Unfortunately the impact on user experience outweighs the functionality - I think we’ll have to get an initial front end setup via Stacker to cater for our need to accomodate read-only users updating and deleting records.
Thanks for your help
Dec 08, 2023 04:33 AM
Another workaround is to use a form that integrates with Airtable. We have built a form that allows you to view the record in the form and have the option to delete the said record.
https://miniextensions.com/miniextensions-form-for-airtable/
Our form will generate a formula that will create unique URL for each record in Airtable. Clicking this URL will load the record in the form. Now, you must have enabled deleting the record. The delete button will show up at the bottom of the form.