Need development and API help? Ask your questions here!
Recently active
Hi guys! I’m attempting to fill in a field with linked records from another table. The values being entered are flight names based on flight confirmations. As flight confirmations go, they often have multiple flights on them. For some reason, even when using the method outlined in the scripting reference, my values are still overriding. Annoyingly, I can quite literally see this happening by watching the table after running the script - so I know the extra flights are going in the right place, they just don’t want to play nicely with all the other flights! The code snippet that’s updating the flights is below, hope someone can help! if (flights !== undefined && flights.length > 0) { // INSERT FIRST FLIGHT let updateRecord = await passengerFlightsTable.updateRecordAsync(record, { 'Flight Name': [{ id: flights[0].getFlightID() }] }); flights.shift(); // get rid of first flight so one-wayers are accoun
I’m trying to overwrite a Field’s options with a list provided dynamically from data that is imported. I have successfully updated the options to use the previous values in addition to the new set of values (similar to the example the documentation provides). However, the use case for my app is to start from scratch: delete all existing records (and ideally field options), and import a fresh set of data with field options that match the new data. The documentation points to UpdateFieldOptionsOpts as a way to do this, but after trying a few combinations, I have not gotten it to work. Any thoughts from the community on what I might be doing wrong? Here is some sample code to demonstrate the issue: let choices = { choices: [ {"name": "Option 1"}, {"name": "Option 2"}, ] } if (field.hasPermissionToUpdateOptions(choices)) { await field.updateOptionsAsync(choices, {"enableSelectFieldChoiceDeletion": true}); }
In a fetch for JSON POST adding these two headers: let response = await fetch(url, { method: 'POST', body: JSON.stringify(data), headers: { 'Content-Type': 'application/json', 'Accept': 'text/plain', } }); returns a TypeError: Load failed message. But the target API needs both headers specified. Each header individually does not error, but the API doesn’t respond. Any help appreciated.
I’m trying to test a very simple script, but I can’t seem to output specific fields to a table, no matter which fields I specific in selectRecordsAsync, the output is always the same: fields id and name. My code: let table = base.getTable("Procedimentos"); let query = await table.selectRecordsAsync({fields: ["Procedimento","Descrição"]}); output.table(query.records); What am I missing?
how to use script to send record to stripe? who can
Hey everyone Having a bit of problems with this script. I have a tasklist and at the end of the record I have a delete button. When I press the button I want it to delete just that record. But when I use this script it seams to delete just any of the records in the list except the record I want to delete. Can someone pls advise? // Delete a record in the Tasks table let table = base.getTable(“Tasks”); let query = await table.selectRecordsAsync({fields: }); let recordId = query.records[0].id; await table.deleteRecordAsync(recordId); console.log(“Deleted a record!”);
anyone know how to use jalali calender in scripting app airtable?
Is there any way to access the history/activity on a record I’m looking for a way to see the rowActivityInfoById for a record so I can audit what fields are being changed over a certain time period. I’m ok with coding it up, I just need to know I can retrieve the activity anywhere. Any help would be much appreciated.
I want use scripting app for convert gregorian calender to jalali calender. I have a field named as ''date" for Gregorian and an empty field named as"Jalali" for result of code. for convert I want use of this code: // let day = new Date().toLocaleDateString(‘fa-IR-u-nu-latn’); console.log(day); // But I don’t know how to put field names in the code! and also I want the result, entry in jalali field.
Hello! I hope this is a simple question for you all, I need to be able to update any field with a certain value. is there a way for me to make the field name that I want to update into a variable so I can change which field I want to edit? var varField = 'fieldnameOrID' base(TableHere).update(RecordHere, { varField: "done", }, function(err, record) { if (err) { console.error(err); return; } }); this is something like what I would want to do. any help?
Hi, I have written a function that fetches the table value based on the table name and primary field number = Uf79266972d007f2a3886bf73676860 async function sendContent(number, studentTable, contact) { const records_Student = await base(`${studentTable}`).select({ filterByFormula: `${contact} = '${number}'`, view: "Grid view", maxRecords: 1 }).all(); var td = await totalDays(number, studentTable, contact) records_Student.forEach(async function (record) { studentName = record.get("Name") console.log("Name = ", name) }) } sendContent(number, "Students", "UserID") It gives the following error AirtableError { error: 'INVALID_FILTER_BY_FORMULA', message: 'The formula for filtering records is invalid: Unknown field names: uf79266972d007f2a3886bf73676860', statusCode: 422 } But, If I pass number as 50373. and call sendContent(number, "Students-2", "ChatID") It retrieves the name successfully. Any idea what is causing this issu
Require Map script to add two markers from two separate fields in table. Im successfully using the script Add image from Google Maps This script populates an attachment field with an image from Google Maps using a field with an address
Hi, I would like to ask what is wrong with this script below. What I’m trying to achieve is search a particular word on a given string and make sure that the word is not misspelled by not having any additional letter or numbers at the beginning or end of the word (Special characters are allowed. Case sensitive search). What happens with this script is, it fails to search for the given word even if nothing is added before or after the word. I have tried my RegEx on online testing tools and it actually works fine. If you guys know any alternative for my scenario please do let me know! Thank you very much. let subcategoryName = currentSubcategoryRecord.name; let keyword = new RegExp(`[^a-zA-Z0-9]${subcategoryName}[^a-zA-Z0-9]`); isProductTypeExists = checkRecord.search(keyword); if (isProductTypeExists == 0) { //Product exists! } // -1 is returned for no match found.
Today Airtable give me error on “filterByFormula” it was working fine earlier. Anyone had same problem like me.? reply : Error parameter validation fail Thanks.
Hi all, I’m trying to link my a “parent” record to new created records in a script following this source. But I keep on getting the error “TypeError: newRecordId.getCellValue is not a function”. The code can be found under " /Link the new record (child) to the parent record/". Thanks for the help in advance… it’s very much appreciated! let inputConfig = input.config(); let table = base.getTable('Progress General Indicator 🚫'); let projectsTable = base.getTable('Projects 🖌'); let indicators = inputConfig.linkedIndicatorIDs; let projectID = inputConfig.projectID; let recordID = inputConfig.recordID; let linkedIndicators = inputConfig.linkedIndicators; /*Create new records (children)*/ for (let indicator of indicators) { console.log(`Adding indicator ${indicator} to the new record.`); console.log(`Adding project ${projectID} to the new record.`); let newRecordId = await table.createRecordsAsync([ { fields: { /*'Projects 🖌': [{id: p
Hi everyone, I found this very good script template, and need help with some adjustements please. “Collaborators” used to be a dependency field, called “Followed By”, but I would like to use this field rather to assign collaborator names, that are stored in a separate sheet called “Collaborators”. The purpose of the Base is to automatically assign tasks and collaborator names to classes. Here is the code: // when a new asset is created, // there are a certain number of tasks that must be completed // these tasks are dependent on the type of asset // Given a list of project and task templates, // when a new asset is created and has a project template assigned // we can then create corresponding set of tasks for that asset // define some of our initial variables // these are the basic table, field and view names to define to create the script const project_table_name = ‘Classes’; const new_project_view_name = ‘New Projects’; const project_template_link_field_name = ‘Project Template’; co
Hello there, I’m Vihar from Appsmith, and I’m here to share a major update on Appsmith’s latest release (1.7.10) with the Airtable community. Today, our integration with Airtable comes out of beta and is available for everyone :tada: ! You can now build custom UIs and interact with applications built on Airtable with minimal configuration. Appsmith is an open-source framework to quickly build any custom business software like admin panels, internal tools, dashboards, and more with pre-built UI widgets that connect to any database, GraphQL or REST API, controlling everything with Javascript. While it is possible to use the default API interface to connect to Airtable, we wanted to make it easier for you to directly connect to your Airtable account and create applications faster than ever. This new data connector introduces several features: Integration is located in the “Datasources” section. Connect to your Airtable account with either an API Key or a Bearer Token (OAuth 2.0). Cre
I am trying to create a script in Airtable to give me the sum of a row in a table, but I am new to JavaScript. Any help would be most appreciated, thank you
I’m using code found from this post and am struggling to figure out how to get past an error of “Error: Field “fldJl8IjqgJizFULv” cannot accept the provided value. at main on line 29” The goal: Separate a list of records into separate records to input into another table along with assigning fields of “Projects” and “Status” What I’ve tried: I’ve performed the script successfully with creating a record with the task name for each task, but when I try to define other fields I end up getting the error mentioned above. Here’s my code so far. Any help is appreciated! I’m so close to getting this, just need a bit of help to the finish line console.log(Hello, ${base.name}!); let inputConfig = input.config(); console.log(The value of ProjectType is ${inputConfig.ProjectType}); console.log(The value of ClientName is ${inputConfig.ClientName}); console.log(The value of TaskName is ${inputConfig.TaskName}); // pick tables from your base here let projects = base.getTable(‘Projects’); let tasks = b
We’re using a view to contain company distribution groups. When a user filters into view, I’d like to add the Active Directory user with that email address to a given M365 group. All I need to be able to do is grab the email address off of the selected record within the script > HTTP call. Is it possible to get the selected record (the record that filtered through and caused the automation to happen) so I can provide the email address off of it to my Power Automate flow?
I’m trying to create a basic badging award system for volunteers as they progress within an outreach program. And I’m wondering if I’ve finally reached the point where I need to learn JavaScript to do what I want in Airtable. The Basics: Match Log table contains all instances in which a volunteer signs up for a workshop. Using pivot table extension I can see each volunteer by row and a count of each workshop that a volunteer has led. The visualization is useful but I want to use the values stored in pivot table to trigger other actions e.g. assigning a badge if certain conditions are met. Doing it manually is a real pain. Would the below be a reasonable approach to writing a script? Is this achievable for a semi-savvy newb? Or should I look to hire a consultant? Loop through each volunteer Loop through each workshop, return count value Assess each value against condition(s) IF condition == True then create a link to Badge table I should also say I’ve posted the same question el
Hi all, I’ve read up in this forum on how to see the Field IDs for the fields in my table. However, I’m struggling with how to to actually use the API to reference those field IDs. Using Python, I’m able to grab the record through the API and convert the data to JSON. I then assign a field in the record to a variable: json_variable = json_data['fields']['Name'] However, after trying some different variations of this, I can’t seem to figure out how to access the field ‘Name’ just by using its field ID. Can anyone help with this? The motivation behind this is to avoid hard-coding Field Names so we can change them in Airtable without the program breaking. Thank you!
Hi there! I’m not a developer but I trying to write a script. Please tell me if is possible to use a variable to define the field name inside updateRecordAsync method. await table.updateRecordAsync(record, {"Phone": value}) the method accepts variables for “record” and for field “value” but I want to use a variable for “Phone” (without quote marks) like the example below: let fieldName = "Phone"; await table.updateRecordAsync(record, {fieldName: value}); I want to let users set up fieldName using input.config Please help. :pray:
I’m guessing the answer is no, but is it possible to add a new option to a Single-Select or Multi-Select field programmatically from a script? At first I tried to just brute force it - I tried to enter a string value for the Single-Select field via table.updateRecordAsync(). This is a way we can add new options via the main UI, although the UI presents a context menu for doing so. Next, I tried to see if I could push() a new value into table.getField("Single-Select Field").options.choices but the API returns the options as immutable, since it’s a get[***]() function: Any way to do this, or any plans to support it in the future?
Hi all, I’m new to scripting in Airtable and I got a bit confused about my error. I’m using two variables for the script projectID which is the ID of the project that is linked to the test record linkedIndicatorIDs which are the IDs of all the indicators that are linked to the test record When I run this script it gives an error “Error: Field XXX cannot accept the provided value.” for the project field although via the console.log I see that the correct projectID is being used. I don’t really understand why it doesn’t work for linking the project if it does work for the indicator (I tested succesfully the script without the project linking). let inputConfig = input.config(); let table = base.getTable('Progress General Indicator 🚫'); let indicators = inputConfig.linkedIndicatorIDs; let projectID = inputConfig.projectID; for (let indicator of indicators) { console.log(`Adding indicator ${indicator} to the new record.`); console.log(`Adding project ${projectID} to the new
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.