Need development and API help? Ask your questions here!
Recently active
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
Hi, I’ve been using Airtable for just over a month now and loving it, been able to create workflows that I’d have needed a whole dev team for before! Just brilliant. But now I’m straying into the world of scripting and feel a little lost, despite lots of reading, testing and trial and error. Think I need to do a course, but in the meantime I’d really appreciate some help. My base is all focused around event planning. For the challenge in question there are x3 tables: 1. Speakers - a list of speakers at an event 2. Sessions - a breakdown of the event sessions. Each session is a row, with speakers associated with each session listed in columns (Speaker 1, Speaker 2, Speaker 3, Speaker 4, Speaker 5) - and yes, I know this is not ideal and I can use a single field to reference multiple speakers, but this is how I’m supplied the data (in old school spreadsheets which constantly update), and yep, number of speakers varies per session! Speakers are linked to the Speakers table as linked recor
Hi there - We have a database with 8000+ records and have been creating a hash with them. It is crashing our automation and exceeding the limit. What are some tips to not exceed the limit?
Hi Team, I have created 1 view and 1 form within air table. As soon as i submit the form 1 row gets inserted in the view. Subsequently, The view is attached to Run Script which gives call to external REST API. Below are the fields displayed on the form. FYI. I have mentioned the fields type as well in the bracket. Field names: customer(Single Select),source category(Multiple Select) and source url(Long text) ,target category(Multiple Select),target url(Long text) and email(Single Line text) etc. Requirement: I would like to dynamically pre-filled the source category and target category fields based on the selection of the value of customer field. Could you please guide and point me to the example/link where i can get idea how this is possible to do in air table?
Hi, I want to get from a table all the records, filtered by one of the columns. For example: I have a field called “SKU”. There are many records in the table with the same SKU, different dimensions of the same products. I want to get, with CURL, all the records with SKU = 1000. How can I do that? Thanks!
Hi there - When I am testing my script, it is popping up and asking which record do I want to test. Will this always be the case or how can I have the variable passed from step 1 in the automation which is the record which is updated?
Hi there :slightly_smiling_face: I’m new to coding and Airtable and I need some assistance. My script is to update a record with user input. The issue I’m running into is in line 7. The script runs but I’m assuming it is this error that stops it from actually updating the cell. I understand the error but I’m just not sure how to remedy it. I’d also like to know how to output the new_date variable within the text output line above it.
Hello Community! I have the below script that will create X number of records based on the Episode Count, but I would like to tweak it to auto-number those episodes each time. For instance, Show 1 has 5 episodes, then each episode record would be numbered 1, 2, 3, 4, 5 //Tables let projects = base.getTable('Shows'); let episodes = base.getTable('Episodes'); //Record Input let record = await input.recordAsync('Please select a project', projects); //Record variables let quantity = record.getCellValue('Ep Count'); let order = record.id; //New record array let recArray = []; //Iterate by quantity if(quantity > 1){ for(let i=0; i < quantity; i++){ //Push to the array recArray.push({ fields: { 'Shows': [{id: order}], } }); } //Create new records await episodes.createRecordsAsync(recArray); } Any insight would be so incredible appreciated :pray: Thank you!
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.