Need development and API help? Ask your questions here!
Recently active
The entire error is; TypeError: Cannot read property ‘length’ of undefined at main on line 40. Line 40 reads; let recToCreate = s.delivField.options?.choices.length; OK, so “s” was defined at the top of the script as input config, and “delivField” is defined as an input field of “s” So AFAICS this should NOT be undefined. Any ideas? Anyone else used this script?
I keep getting error: SyntaxError: Unexpected end of JSON input at main on line 32 Is this something to do with my return JSON string from my endpoint or something to do with my code? Here is the code let WPtable = base.getTable("New WP"); // Prompt the user to pick a record // If this script is run from a button field, this will use the button's record instead. let record = await input.recordAsync('Select a record to use', WPtable); let blogTitle = record.getCellValue("Title"); let wpContent = record.getCellValue("Content"); let c_name = record.getCellValue("Name"); // had to change to c_name because Visual Studio code was saying name is deprecated just in case I'm using a namespace let bannerhead = record.getCellValue("Bannerhead"); let headline = record.getCellValue("Headline"); let subheadline = record.getCellValue("Subheadline"); let cta_text = record.getCellValue("CTA Text"); let cta_link = record.getCellValue("CTA Link"); let short_path = record.getCellValue("Short Path"); //
If I have a webhook / cURL function (below) - how do I create a script that will run it through timed automation in Airtable? curl -X POST https://app.powerimporter.com/v1/api/workflows/XXXXXXXXXXXXXXXXX/XXXXXXXXX/sync
When deploying my website on Vercel, I always receive the error 429 due to Airtable rate limitation, which I’ve never seen on the local server. I guess this problem is due to the server execute the page build much faster. In that case, is there some way to handle this limitation?
I’d written a simple script for some field Supervisors to be able to pull and generate a report of who’s signed in to their jobs on a given day. It was working fine until the beginning of this week, when all the times got adjusted by 4 hours from when they actually happened. A crewman will sign in at 9:04am, but the report will show them signing in at 1:04pm. This is new and unexpected behavior. GMT for all is turned off on all fields, they should all be localized, and were for the previous month since release. All team members are in EST. After some testing, it seems that Airtable is now dropping the ISO 8601 time zone adjustments. I am uploading them, but they are not being retained when the base is referenced. I am sending (and have been in the same format since the beginning of June) “2022-06-22T09:40:01-04:00”, and I am receiving back in the same API call as a response: “2022-06-22T13:40:01000Z” (Which I haven’t been until 6-20-22) If someone at Airtable can confirm that this is “
Hello. I have problems with automation, I ask you for help. I have table 1 and table 2. When I create some record in table 2, automation is triggered and all data is created in table 1. But when I want to make some changes in table 1, then these changes are not reflected in table 2. Tell me how can this be done?
let table = base.getTable(“Cuentas Ads”); let view = table.getView(“check grupal”); let query = await view.selectRecordsAsync({fields: }) let updates = query.records.map(r => { return {id: r.id, fields: {“Check Grupal”: false}} }) while (updates.length > 0) { await table.updateRecordsAsync(updates.slice(0, 50)) updates = updates.slice(50) }
Currently in REST API - Airtable for my base, I see this in description for creating a record: Your request body should include an array of up to 10 record objects. Each of these objects should have one key whose value is an inner object containing your record's cell values, keyed by either field name or field id. But when I use this code: table.create([{ "key": { "id": "45673157744282"}, "fields": { "purchase_date": "2022-01-08T01:49:22Z", "orderID": "155-5041239-4465010", "order_status": "Shipped", "sales_channel": "Amazon.com", // ..... } },]).then(result => { console.log("Result=", result); }).catch(err => console.log("Error=", err)); I get this error: AirtableError { error: 'INVALID_REQUEST_UNKNOWN', message: 'Invalid request: parameter validation failed. Check your request data.', statusCode: 422 So all I need to do is to be able to pass the key (id of the record to be created) while calling the .create(). How do I do it?
I’ve written this little script and it runs very well as an app. But if I run it as an automation run script, it runs successfully but does nothing, no update and no error. I’d like to understand why the automation mode is not effective ? Thanks for your help. const tEssai = base.getTable(‘Essai’); let rec = await tEssai.selectRecordsAsync(); const dte=new Date(); await tEssai.updateRecordAsync(rec.records[0].id, { “Nom” : “Foo”+dte.getMinutes(), “date1” : dte })
I am sorry for my poor English. I want to write a script and get the information on a specific table. Using the EXAMPLE code of Loading records, I can only get an ID and a name. The records I want are the information I brought from other records. Is there a way to get all the information?
Hi there - We are trying to filter records based on multiple IDs but it is doing so in a loop so we can’t use the || or && as we don’t always know if there are multiple and often times there are 5 or more variables. We want something like this: var these= tabale_await.records.filter(f_record => f_record.getCellValueAsString(“Term_at_id”) == [any of these]) Is it possible?
This is a real noob question, so forgive me… I want to call a script that will include user inputs. Whenever I try and do this from the automation interface, the code declaration errors. I have found the script app in marketplace and can successfully run this fragment within the editor: output.markdown(’# Hello, world!’); let name = await input.textAsync(‘What is your name?’); output.text(Welcome to the scripting app, ${name}.); My question is how do I call this from an automation or a button anywhere else?
Trying to take Object returns from my PHP endpoint and populate the rows of a table - only the first row is being populated (aka cell fields in first row only) - here is my code: // query for every record in "People" let table = base.getTable("SMS"); let view = table.getView("All"); let query = await view.selectRecordsAsync({fields: ["Contact","URL"]}); var json_payload = []; let individual_injection = {}; for (let record of query.records) { let name = record.getCellValueAsString("Contact"); let URL = record.getCellValueAsString("URL"); individual_injection = { 'ID': record.id, 'Name': name, 'URL': URL }; json_payload.push(individual_injection); } console.log(JSON.stringify(json_payload)); let response = await remoteFetchAsync('http://147.182.192.192/speech.php', { method: 'POST', body: JSON.stringify(json_payload), headers: { 'Content-Type': 'application/json', 'Authorization' : 'Basic d2h5d29udHlvdWNvbm5
I’m trying to delete a record if my function fails to find a match with the query. //The Record ID I want to find a match for in the sourceTable let recordIDsource = inputConfig.recordIDsource // Find records in sourceTable let query = await sourceTable.selectRecordsAsync({fields: ["Record ID"]}); //Select the records from the query with matching Record ID's let recordTOupdate = query.getRecord(recordIDsource); If there is a matching ID this works great and gives me the record ID of the record containing my matching “Record ID” in a field. (I know, confusing) The problem is when there is not a matching “Record ID”, rather then giving me a value of null or undefined or 0. I launches an ERROR and breaks my script. What I want to do is, if there are no matching record ID’s, I want to delete theRecord that triggered the automation in the first place. if ( query.getRecord(recordIDsource) === Error ) { await table.deleteRecordAsync(theRecord); } I know that code above "
Hey, It takes a long long time to await table.selectRecordsAsync only to get a single record by id. Is there a way to get a single record by ID from a table? Or multiple records by array of record IDs? Use case is a very common one - once I get record ids from a linked record field I need to get the respective records from the linked table. Thanks, Ronen
I have an app that requires users to add a user token, which it validates against the Gumroad API. But I’m seeing this error. Airtable has a document that introduces the new security policy New: tighter security and network access option for marketplace apps, but it doesn’t actually say how to make sure your app supports the new policy. Is it as simple as setting the Content Security Policy header to include https://api.gumroad.com/v2/licenses/verify?
Hi all, I have a CRM in Airtable and looking to automate merging contact records if the email address matches. This would include merging multi-select and linked fields. I know there’s the dedupe app, but I’m looking to automate this so the dataset is always up to date. Can anyone point me in the right direction with how to do this via a script please? Thanks in advance!
I already have an existing database with about 3500 records. Each record contains a high rez image of a piece or artwork. The database was originally created for the sole purpose of keeping records of an artist’s work. The needs have grown. We are near the 20 Gig limit that Airtable allows our Pro account for images. I would love Airtable to look into a folder (Dropbox or something similar) and match a record number with file names. If it sees a file name that matches the record name it looks to see if it has an image in the image field. If it does not, it imports that image. If it does have an image it checks the date of the last import and if it matches the creation date of the file it does nothing. If it finds that the creation date of the file is newer than the last import date, it deletes the image on the record and uploads the newer image. I also would love to automate the creation of links to be able to download hi rez versions of the image files in the record. I am trying to ma
Hi guys, first post for me and i’m french native so sorry for spelling mistakes I have a base that shows every forms (one record for one form) and I would like to automaticaly fairly attribute a single select choice to each of these forms when they are submited I have 3 developers and I would like to fairly attribute them a form (ex. I have 90 forms/I would like 30 forms per dev) Here I’m attributing it manually Thanks you guys
Hello! I am trying to achieve the following. I would like to update my stock on button press by adding or removing the value given in the cell. Please help. Thank you very much in advance!!!
I am looking for a script to insert the current date and time into a field when you hit a button. Currently, my users just hit the “Today” button when the calendar pops up in the date-time field when they begin a task but I would like to just have a “Start Task” button. I am new to scripting and would appreciate it if someone could walk me through this first application.
Greetins! I am starting a new project where in which I will write a script that needs to be triggered… at regular intervals (eg. daily) ad hoc, manually by a user Automations work well for the first case, and scripting app for the second case. However, I wont sleep well at night if I have to maintain two copies of the script, one in Automations, one in the scripting app. What would be the best approach to not duplicating the code here? For now I am thinking of… a first automation with an incoming webhook trigger that runs the actual script a second automation with a scheduled trigger that runs a one liner script to call the webhook (and this covers my first use case) a scripting app with the same one line script that calls the webhook (which covers my second use case). Any better idea way of doing this? Thanks in advance!
I’m trying to read what are the width/height of a given image. The following JS code works fine outside Airtable: const img = new Image(); img.onload = function() { alert(this.width + 'x' + this.height); } img.src = 'http://www.google.com/intl/en_ALL/images/logo.gif'; But when writing an Airtable script, const img = new Image(); yields ReferenceError: Image is not defined. Is there another way to know what are the width/height of an image within an Airtable script?
Hello, I’d like to embed a Form in an iFrame or Webview of my WebApp because I like the way to display link records BUT I don’t understand: Testing the form I have beautifull preview with autocomplete, etc …: If I test the form “as a user” I lost all the fancy features: What should I do ? Is there a trick to embed a form with all the good looking ? Or should I code it ? Is there some kickstart to handle autocomplete ? This issue might be similar to: Showing more information with link fields on a form Views If the Link field accepts multiple linked entries, then the person filling the form can add additional options once they open the form. The one they click from will be pre-filled, but they can add more options once in the form. That may be about the best you are going to get with Airtable’s current incarnation of forms. But no real answers :frowning: What’s the point to loose “hard to code” features ?
I am trying to create a record on airtable and I am getting that createdRecords is “undefined”. All the variables FirstName,LastName,Email,JobLevel print to console but then createdRecords is undefined. const Airtable = require('airtable'); var base = new Airtable({apiKey: 'VARIABLE'}).base('VARIABLE'); const table = base('VARIABLE'); var FirstName = event.user.given_name; var LastName = event.user.family_name; var Email = event.user.email; var JobLevel = event.connection.id; console.log(FirstName,LastName,Email,JobLevel); const createdRecords = await table.create([ { fields: {FirstName, LastName, Email, JobLevel} }, ]); console.log(createdRecords); This is all part of auth0 post login action that looks like this exports.onExecutePostLogin = async (event, api) => { const Airtable = require('airtable'); var base = new Airtable({apiKey: 'VARIABLE'}).base('VARIABLE'); const table = base('VARIABLE'); var FirstName = event.user.given_name; var LastNam
Already have an account? Login
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.