Jun 24, 2019 04:10 PM
I’d like to do the following:
The use case is essentially: we keep a table in airtable that tracks membership in a community, and I want to let folks initiate a workflow to onboard new members.
Is this possible?
Jun 24, 2019 07:27 PM
Yes – with a couple of caveats:
If you have additional questions, feel free to message or PM me.
Jun 26, 2019 10:47 AM
Thanks, this is very helpful.
It looks like Zapier’s Push extension is a chrome extension, so everyone who wanted to have the button available would need to install the extension, which is not ideal for my use case. Am I understanding that correctly?
You also mentioned a URL field configured to message a webhook trigger – not sure what you’re referencing here, exactly. Could you say more about that?
Jun 27, 2019 09:22 PM
Sure. You can create an incoming webhook in Zapier, which is essentially a Zapier.com URL that generates a trigger when it gets hit with an HTML ‘GET’ request — like a browser generates when you click on a URL on a webpage. You can define the webhook in Zapier, which will give you the URL to use. Create a formula field that concatenates the webhook URL and the Airtable record ID. I don’t recall the exact syntax Zapier uses, but your formula would be something like
{Webhook URL}&'record_id'&RECORD_ID()
That will create a clickable URL that will trigger a Zapier webhook and pass it the record ID of the Airtable record that contains the formula field. Click the URL, and a GET request is sent to Zapier, triggering the webhook and passing along the record ID. That’s an example of a one-to-one trigger like I mentioned in Item 4.
If users are coming from a view where they have write capabilities, which means they can check a checkbox, you can bundle the RECORD_ID()
s together and send a single webhook that passes multiple IDs to Zapier. (Again, I don’t recall the exact syntax, but Zapier has eye-wateringly beautiful documentation for most of their modules, and the help page for ‘Webhooks by Zapier’ clearly explains how to create a multiple-trigger webhook.) You’ll have to add some complexity to your base:
First, create a linked-record field from each record in your main table to a single record in another table — a step that can also be automated with Zapier. Call the new table [Selections]
.
Add a checkbox field to your main table called {Select}
.
Create a formula field in your main table called {Selected}
with the formula IF({Selected},RECORD_ID())
.
Create a rollup field in [Selections]
called {Selected Records}
that follows the link back to [Main]
and rolls up {Selected}
with an aggregation formula of something like 'ARRAYJOIN(values)
.
Note: The exact configuration of both the {Selected}
formula and the {Selected Records}
aggregation function will both depend on the precise syntax Zapier uses to send multi-trigger webhooks, so you may need to modify them both. You may wish to use an aggregation formula rather than an ag function in {Selected Records}
that creates the actual webhook, specifying something like 'http://[ZapierURL]/?'&ARRAYJOIN(values,'&')
— but, again, this is entirely dependent on the necessary syntax. You may find it easier to aggregate the record IDs as a rollup field and then build the webhook URL using a formula field. In any case, what you should have when you finish is the properly formatted URL with the aggregated record IDs appended as a search parameter (that is, the part of the URL including ’?'
and everything that follows).
Finally, create a lookup field in [Main]
that follows the link to [Selections]
and looks up {Selected Records}
; call it {Webhook}
.
To use this multi-trigger webhook, first select all records you wish to send by checking the {Selected}
checkbox. This will result in every record in the base containing a copy of the multi-trigger URL in {Webhook}
. Clicking on the URL in any record will issue a Zapier trigger for each and every Airtable record selected.
I hope that’s reasonably clear. (It probably would have taken me less time simply to look up the freaking syntax for a multi-trigger webhook than it did to type that caveat about ‘proper syntax’ a half-dozen times, but by the time I realized that, it was too late. :winking_face: )