![]() And to be fair, they’ve owned this from the start (I’m actually rather impressed by the clarity of their vision/roadmap). I totally get it as their business model is clearly focused on monetizing the front-end UI and features (blocks, colors, etc). The biggest gotcha is ensuring that if your request (or requests in the case of batches) returns anything OTHER than a 200 HTTP response code, you cleanly exit rather than syncing an empty response (this has happened to me and it is unfortunate).Īirtable continues to double-down on NOT being a proper backend for data-they are fully invested in their front-end and have let all of us API users nibble on the meager crumbs they throw our way. The only way I’ve managed (sane) syncs is by:įetching all records from a table (usually in batches), creating a hash using specific fields, comparing that hash to a cached value associate with that record ID, and only THEN can my script tell if that record has changed. Zapier doesn’t have a “trigger” for Airtable updates (just new records) and the API (as you know) doesn’t expose date modified (only date created). Any comments or questions - let me know.To the best of my knowledge, NOTHING can track changes/updates to records other than Airtable itself. (Something I might have a go at when I get some time).Īnyway, hope you might find a use for this. Very easy to do this in a code component triggered by a webhook call. One of the things that AT doesn’t do right now, for example, is allow you to iterate on items in an array field - example, sort and dedupe an array of values. For the coders amongst you, lots of opportunities to implement more complex functions than AT natively provides.Webhook -> AT Find Record -> Do Something -> AT Update Record However, very possible that you could do: I’ve used run python components, which, obviously, you need some familiarity with code to be able to implement.I’ve used webhook triggers with fewer components, so it is doable on a free Zapier plan. This Zap uses 4 components, which needs a paid Zapier plan.Clicking on the webhook URL opens a new browser tab and you get a JSON response to the call.no record ID params) and the webhook triggers an update to multiple records in a view - in this example, maybe all of the records without a German translation. I’ve shown this with an update action per record, but you could easily have the same webhook URL in every record (i.e.the functionality here is a translation, but, of course, it could be anything (yes, I know AT has a translation block already :winking_face: ).Once all set up, you can click on the webhook URL in any record and trigger the translation Zap: Response = requests.patch(return_url, headers=headers, json=return_data) This component takes the translated text and sends it back to the same record in Airtable using: import json The output of this component is the EN text and this gets passed to a Zapier translate component, which translates it to German, passing the translated text to the last component - another Run Python. Response = requests.get(get_url, headers=get_headers) The record ID gets passed from the webhook component to the 2nd component in my Zap - a run python component with this code: import json The webhook component is a Catch Hook and I append the webhook URL with the record ID of the Airtable record: writes the translated content into another field in the same record:.I have some text in English and I want to translate each record of content into German: My demo for this is based on translating content from one language to another. By using webhooks to trigger the functionality, it can be executed an arbitrary number of times for any record. One downside to this, which this demo gets around, is that a record can only be triggered once (or once as a new record and once in a given view). I frequently use Zaps in my bases and they are mostly triggered by the standard Airtable triggers - new record or new record in a view. But…Zapier provides a webhook component that can be invoked to kick off a Zap. In most web apps functionality will be invoked by the click of a button - save edits, delete a record and so on - but this button functionality isn’t available in Airtable. I was thinking about how to add some functionality to a base and, for the base user, how they would trigger this.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |