Need development and API help? Ask your questions here!
Recently active
I have an automation that I need to count all records that meet a certain criteria. The number of records that meet this criteria exceeds 100, so the find records tool isn’t useful. There is a scripting block in the automation and I would like to count them there, but I’m not seeing an easy way to do this. I only need the step to return the count of records that meet the criteria, not the actual records themselves. Has anybody done something similar? Ideally I could make a view with the criteria filtered and then have the scripting step return the number of records in the view, but I don’t see any documentation for a function to fetch record count within a view in the API docs. Also don’t see a way to use selectRecordsAsync with an offset to capture all records that meet a criteria instead of just the 100 allowed by the function as it currently exists. Any thoughts?
Hi, I’m writing a program in Node.js using AIrtable API that fetches the record from Airtable and sends it to WhatsApp. The problem I’m facing is that for example, there are three columns COL1 | COL2 | COL3 I’m trying to achieve that if any of the columns are empty, it skips that one and moves on to the another. But when I execute col1 == null || col1 == undefined it returns false. This statement returns true only for the last column. Also when I execute col1.length it returns 1 but for the last column, it returns Cannot read properties of undefined (reading 'length') I don’t understand why the empty cells/ column before the last one doesn’t return undefined.
Hi, Professionals here, I encounter a problem, I want to use EmailJS service to send HTML emails. I try the automation of Airtable, the actions of “finding records” and “sending email”, but it is not as intelligent as I want, So I want to use EmailJS service. So I wrote the below code in Airtable script. let params = { service_id:'service_gbwx81a', template_id:'template_6euwe2d', user_id:'cxkTio1YLQSY241rj', template_params:{ to_name:"Stone", from_name:"Stone", reply_to:"Stone", message: "ABC", } } let headers = { "Content-Type": "application/json", }; let options = { method: 'POST', headers: headers, body:JSON.stringify(params), }; console.log(JSON.stringify(params)); let emailJSURL = 'https://api.emailjs.com/api/v1.0/email/send'; await doRemoteFetch(emailJSURL, "POST", params); async function doRemoteFetch(url, postOrGet, body = null) { let success = false let fetchedData = null let fetchOptions =
Hello, How do I pass function parameters as JSON field name for updating fields in Airtable using Airtable REST API and Node.js? The code const updateField = async (id, field_name, updateValue) => { base('table_name').update([ { "id": id, "fields": { field_name: updateValue } } ], function (err, records) { if (err) { console.error(err); return; } }); }
I am creating a proof of concept script which you can see below: const data = { title: 'AirTable Pusher', content: 'Push, push, push this.', excerpt: 'The short version' }; let response = await remoteFetchAsync('https://staging2.conveyancingqld.com/the_vision.php', { method: 'POST', body: JSON.stringify(data), headers: { 'Content-Type': 'application/json', 'Authorization' : 'Basic d2h5d29udHlvdWNvbm5lY3Q6Y2N1WSAxWWhkIDdsTmkgMzdWSSB5MVlyIDYySEs=' }, }); console.log(response); The return on the server side if you check at the time of this writing is: {“a”:1,“b”:2,“c”:3,“d”:4,“e”:5} It returns some JSON data - I want to access that in the AirTable script - however when I check the Console log response it says the following: {type: "basic", url: "https://staging2.conveyancingqld.com/the_vision.php", status: 200, statusText: "OK", ok: true…} type: "basic" url: "https://staging2.conveyancingqld.com/the_vision.php" status: 200 statusText: "OK" ok: true header
Hello, i am setting up a Google Apps Script to update some records from our student information system. I was able to set up an array of records in the required format for patching the data in Airtable, i also got it to work, however whenever there are more than 10 records i get an error, so i am trying to figure out the best way to process them 10 at a time using plain JS or Google App Script. I was thinking of implementing a for loop to send a patch request for every record, but that did not seem like the smart way to do it. I wondering what was the best way to break it down 10 at a time Thanks Anto
I tried to use input.buttonsASync but it’s impossible. I receive this error: “ERROR TypeError: input.buttonsASync is not a function at main on line 2” Can you help me?
Mi update with curl doesn’t work and i dont know where is the error Record id, url and key are corrects (they works with delete and create rows), but not with update. ¿Can someone help me? Thanks for your time!
Hello there, I’m having troubles to set up the “hello world” to develop a custom app. I’ve followed the guide as well as search for possible solutions without success. I’m using Chrome on Mac, “block run” is running with “https://localhost:9000” but both Airtable and Chrome are unable to access to localhost due CORS issue. I’ve tried to use chrome extensions to allow all origins but any luck. Tried to use a Proxy, no luck. I think the problem is in the Node server since if I try to reach localhost:9000 with Postman, I get the listing of Browser-sync and not the compiled React app source. Thanks for any heads-up
Today is my first foray into scripting with AirTable and i feel like the best method of learning how to script is to figure out a use of it that would be easy and useful. So i want to create a button that would copy certain fields and input them into a new row. For instance, my company manages affordable housing vouchers and we want to keep track of units that do not work out, but the voucher recipient (potential tenant) will still be searching for a new unit. Instead of rewriting over existing data, i wanted to make a button that would copy these fields: Participant Name Specialist Name Action Program URL NOTES and input them into a new row with an updated STATUS of “Back OTC”. So we know that this person previously attempted to move into a unit, but that unit didn’t work out, now they are OTC (on the clock) to go find a new unit. Does that make sense? i feel like making a button do this with a script should be a perfect way of getting my feet wet into scripting in general. I appreci
Hi there I’m new to automation scripting and would appreciate some help I start my app with a trigger when a record is added to a table. How can I use (reference) the fields from the trigger record in my script? Trigger return a record with the name of a city I want to query another table inside my script and find all the records with that city and then do some other calculations based on the records returned from the query. Please let me know how to do it, and if possible, where can I get some ‘more advanced’ examples
I have managed to create a get request (I’m 90% no code) and then info is coming back but how to then write it to a field?. let table = base.getTable("TARIC Code") let url = "https://www.trade-tariff.service.gov.uk/api/v2/commodities/"; let config = input.config(); let response = await fetch(url + config.commodityCode ); console.log(await response.json()) I want to take the result directly into a field to then sift through it for what I need.
Hello, Can someone help me to write a code to extract all the URLs associated with my attachment in a particular record? As you can see here, i have 3 photos where i need to generate “https://dl.airtablexxx1,https://dl.airtablexxx2,https://dl.airtablexxx3” in a field named “joined” Thank you for helping me
I found a script that fetches info from IMDB (Image, synopsis, etc.). My question is how do I alter this code to remove the need for user input. Here is how the script works as is, and I’ll insert the code below. Titles are put into the script, When it runs it asks for the user to click a button to pick which title to fetch. Then it shows you the data. And adds it to a record. I want to eliminate the need for a button and have the script fetch all the titles within the list. // Get an API key from OMDB here: http://www.omdbapi.com/apikey.aspx const OMDB_API_KEY = 'xxxxxx'; // Shows all the button groups together and waits for a button click // Returns the first button that was clicked async function chooseFromButtonGroups(label, buttonGroups) { output.markdown(`## ${label}`); return await Promise.race(buttonGroups.map(([label, options]) => input.buttonsAsync(label, options) )); } async function addTitle(title) { const info = await fetch(`https://www.omd
Hi guys, I’m not a developer, or programmer by any means, and I’m struggling to have two different types of fields syncing. It seems my only problem is that Field2 (the target) is a Linked Record field, and Field1 is a Single Line text field. I have no clue what to do at this point… The script i have so far looks like this // get the table let table = base.getTable("Table1"); let query = await table.selectRecordsAsync({fields: table.fields}); // loop through the records for (let record of query.records) { // now update Field 2 with the array of IDs in Field 1 let msCopy = await table.updateRecordAsync(record, { "Field2": record.getCellValue("Field1") }) }
I want to use scripting to go around AirTable restriction of syncing into one base and not being able to reflexively update the other. The goal is that we have one person in the company that manages property owner data, and I am looking for a way to allow him to have his own space. Right now the plan is to sync W9 submissions from one base to the Property Owner Data manager base upon entering a certain view. In the other Base, the PO Data manager will be able to review the W9 submissions and put in an approval or denial with an attachment that would go back to the home base–updating the status. I know that On2Air and other pay for services offer this. And i can always leverage emails. But I was wondering if perhaps by using a button column in the sync receive base that would ignite a script that would read into the original base, find the matching row and update it to show that it has been approved. Is this possible? Drew
I saw a few posts regarding posting a webhook, but didn’t see this type outlined below. I used it to send a prefilled form URL from AirTable through to Integrately (or Zapier etc). I’m not a particularly good coder so any feedback would be welcome! let inputConfig = input.config(); //URL is defined here let url = "URL OF THE WEBHOOK GOES IN THESE QUOTES"; //This is what the webhook is sending. You can customise the name of each parameter in the brackets. let payload = { "Variable1": inputConfig.Variable1, "Variable2": inputConfig.Variable2, "Variable3": inputConfig.Variable3, "Variable4": inputConfig.Variable4, } let postOptions = { method: "post", headers: { 'Accept' : 'application/json', }, body: JSON.stringify(payload) } //This is the code to post the webook with the parameters await fetch(url, postOptions);
Some applications like Twilio ask for a webhook where they can POST responses. Therefore Airtable is a good candidate for such integration. However, Airtable always return { success: true } after the webhook succeeds, which triggers an error on Twilio: Invalid Content-Type: application/json; charset=utf-8 supplied Is there a way to prevent Airtable from returning such response? I’ve found this topic already Silencing webhook received responses but no solution was provided. Thanks in advance!
Hi! Previously, I uploaded an attachment to Airtable (let’s say A), using API. Now, I have replaced it with some other (let’s say B). Now, generally since A was replaced with B, there should be no trace left of A - right? But actually, when I go to the URL of A, the image is still visible. Should I assume it’s still there in my base, still holding 1mb (size of A) of my Attachment space? Since I have replaced it, why is it still viewable? So, is it possible to make Airtable delete the image permanently, so it doesn’t occupy space in my attachments limit of 5GB? Or any workaround for this? I don’t want to keep track of previous images, and if user replaces it, the previous one should be permanently deleted, and the new one would appear from then. Any help would be great :smiley_cat: Thanks! :)
Continuing the discussion from Exporting a formatted list of linked records: Hello everyone ! I’m trying to find a solution to my problem but I think it’s beyond my capabilities. I’m learning JavaScript, so I’m able to take a script that’s already written, and modify it minimally, but in this particular case, I can’t figure out how to make it work. I integrated this script into an equipment rental database, and managed to get it to work but only under one particular condition. In my assets (“Types”) table, some assets are linked to a rental (“Locations” table) but some are not. The script only works if all the assets are linked to a rental. It breaks if the first asset (position [0] of the array) of the list does not have a linked record. I figured it was not working because the field was not populated, so I added a new rental to all the other assets to see if it worked and it did. The problem is that I have a list of over 700 assets, and they aren’t always all rented at the same time.
Hi, I am super new to Airtable scripts and I am stuck with trying to fix this error. It looks like I need to add the topLevelAwait module somewhere, but not sure where. So far what I did was to install the Hello-World app in my localhost and then replaced the contents of index.js with the contents of the [YouTube Example Script](https://airtable.com/marketplace/scraGQUFvORtvmHC5/import-youtube-analytics) since it does similar things to what I need and I would like to learn from it. The issue is that when I do a block release I am getting: ModuleParseError: Module parse failed: The top-level-await experiment is not enabled (set experiments.topLevelAwait: true to enabled it) File was processed with these loaders: * ../../../../usr/local/lib/node_modules/@airtable/blocks-cli/node_modules/babel-loader/lib/index.js You may need an additional loader to handle the result of these loaders. Any help will be appreciated, Thanks in advance!
Hello, I just enabled the pro version of Airtable in order to use the Maps block. I have just a little over 3000 rows, each with an address. After working (quite slowly) to add the 400 addresses to the map overnight, the block stopped and displayed the message “API quota exceeded. Click to retry”. If I retry right away, it runs blank for a while then displays the message again. If I wait a bit before clicking, it will start adding a handful of addresses. I’ve still got about 2600 rows to go and don’t want to keep coming back to this and clicking retry every couple of minutes… How can I get all my addresses properly added ? My airtable is a simple list of 3000 business addresses I imported from excel. I was handling this list with geobatch before with no issue. Now, I am left scratching my head as to why is this so slow and seemingly complicated? A few years ago this kind of thing was easily solved using excel and businessmap, but I was hoping airtable and a simple google API could h
Hello, I’m trying to access paginated records via API and return specified fields in the ‘fields’ query parameter. But when I include pagination offset to the following requests and modify fields that should be included in response, it makes no effect. Only fields that were specified in the first request are returned, no matter if I don’t pass ‘fields’ parameter in the first request and when I do in the subsequent requests with included pagination offset. Is it possible to achieve?
I’m attempting to add a custom gif into a custom app. The file is stored in frontend/assets/selectTable.gif. import selectTable from '../assets/selectTable.gif' ... <img src={selectTable} /> In my terminal window, I see Bundle Error: Unexpected character ''. Does anyone know how to load an image?
I’m looking to find a way to trim (or crop) of an audio mp3 file (in an attachment field) and paste it into a different field based on the timestamps I give it. I’m unable to find anything out there that can do this in the background (like Zapier), and am wondering if a script could do this. Thoughts? Thanks!
Already have an account? Login
No account yet? Create an account
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.