Feb 28, 2020 01:25 AM
Hey, is it possible to create some Action Buttons to push webhooks with json data with the scripting block?
Jul 23, 2020 09:02 AM
It’s not currently possible to prevent the Blocks sidebar from opening when using this method. It’s a highly-requested modification, though. Several users (myself included) have asked for this in various threads. I can’t find a single request thread for this change, but it couldn’t hurt to write to Airtable support directly and let them know.
Jul 23, 2020 10:27 AM
Well, I believe you could eliminate the button and use a script action (see beta offering) to invoke the script silently. A few caveats…
Oct 08, 2020 09:22 AM
Great! but im having an issue, how do i use a variable inside the payload ?
thanks in advance
Oct 08, 2020 09:49 AM
There have been significant updates to Airtable’s automation system since the earlier part of our conversation. Could you share more details about what you’re trying to achieve? We can give you more accurate guidance that way.
Oct 08, 2020 10:07 AM
I tried this script and work fine with a string value, but i want that everytime I click on the button I could get all the info from a specific row (id)
let url = “URL_ENDPOINT”;
let table = base.getTable(“Sorteo”);
let view = table.getView(“vista”);
let record = await input.recordAsync(“Pick a record”, view);
let payload = {
“set_variables”:“record”,
“set_variables_values”: “i need here the value of a record”,
}
let postOptions = {
method: “post”,
headers: {
‘Accept’ : ‘application/json’,
},
body: JSON.stringify(payload)
}
const postResults = await fetch(url, postOptions);
const jsonPost = postResults.json();
let id = (jsonPost.field + " = " + jsonPost.value);
Oct 12, 2020 10:50 AM
You’ll need to add lines to your script to get those values, then insert them into the payload variable. Each field’s value must be collected separately using either the getCellValue
or getCellValueAsString
methods. For example, if you have a {First Name}
field, the line to collect its value would look like this:
let firstName = record.getCellValue("First Name")
How you add the collected field values to your payload object will depend on the JSON structure required by the API you’re calling.
Oct 29, 2020 01:20 PM
Hi, How are you thinking about security here? Is there a way to store secrets for calling the api without exposing them on the JavaScript/html of the client?
Is there a way to tell air table to invoke (server side) the service on your behalf, injecting secrets server side rather than invoking client side?
Thanks
Oct 29, 2020 06:02 PM
The example I gave earlier is part of a system that has only one user: me. It’s admittedly pretty sparse on the security side because only I have access to the data and accounts. For situations where security is a greater concern, it’s probably not the best. My understanding of how to handle security in those situations is slim, but On2Air: Storage—part of the On2Air series of products by @openside—is specifically designed to work with Airtable for the purpose of securing storing data needed by Airtable scripts. It’s definitely worth investigating.
Oct 30, 2020 01:15 AM
Thanks. Very interesting, I’ll check them out.
Jan 16, 2021 03:21 AM
Hi Justin,
thanks for your example.
I’m using it in a Test Base. In that base i have a button which starts the script.
I was expecting that the script runs automaticly and the record id pushed to integromat.
But if i click the button i need to select a record first in the script. Only after i’ve done that manually the script sends the data to integromat.
Am i making something wrong here or do i miss something?
Thanks for your help.
Here is the link to the test base: Airtable - Webhook Integromat (Test)
Have a nice weekend.
Kai