Save the date! Join us on October 16 for our Product Ops launch event. Register here.
Dec 03, 2022 12:21 PM
I have a fairly complex set-up with Airtable automation and Integromat automation that does a whole bunch of stuff very nicely. I'll attempt a simple description of one part of it that is relevant to my request...
People can use a form to "watch" for changes in a record. Their email address is added as a multiple-select option to that record when they submit the form. The automation I've set up sends them an email when that record changes.
This all works fine but now I want to allow them to cancel this alert and I'm a bit stumped. My thinking is that they can use a second form which references the record and their email address and when it's submitted the automation will look up the record and remove the multiple-select option that matches the email address if it exists.
I just don't know how to do this. I'm assuming a script will be required and I'm not familiar with scripting myself.
Help? 😅
Dec 04, 2022 01:53 AM
Oooh. Looks like it got a bit further but now we have this error:
ERROR
TypeError: Invalid arguments passed to recordQueryResult.getRecord(recordId):
• recordId should be a string, not an array
at main on line 11
Dec 04, 2022 01:53 AM
This is for me the fastest way to access the input variables.
I kept your names there, but actually you could also shorten it by renaming the input variables to recordToUpdate and emailToRemove and only us this:
Dec 04, 2022 01:56 AM
True,
Your product_record is a linked field - there could be multiple products linked, so it is array of recordIs if you are sure it is only 1 , you could do this:
let recordToUpdate = product_record[0]
This will pick the first link from the array of records.
Dec 04, 2022 02:02 AM
Amazing! That worked! Thanks so much... no way I would've worked that out myself. 😁
The form will autocomplete via a link in the alert emails that go out with the record ID and email address. I'l;l limit it to single select so people don't try to add more.
Onto the next stage of testing.
Thanks again. ❤️
Dec 04, 2022 02:05 AM
🤘🚀Cool!