Need development and API help? Ask your questions here!
Recently active
I am looking for suggestions to change my script so that it does not time out. My script is below. Basically when a new record enters a view on a Table A (‘Verifier Bodies’), I want to update another Table B (‘Technical Comments for VB’) by linking all the records in that view in Table A to records in the view on Table B. The script below ‘works’, but is now timing out due to the number of records. I think I need to make a change so that just the new record is added to the field ‘Verifier Body List’ in Table B without overwriting the already linked records. How would I go about that? Any help is appreciated. let TBTable = base.getTable(“Technical Comments for VB”); let TBView = TBTable.getView(‘General Share for VB’) let TBQuery = await TBView.selectRecordsAsync(); let TBRecord = TBQuery.records; let VBTable = base.getTable(“Verifier Bodies”); let VBView = VBTable.getView(‘List of SLCP for Higg Co.’) let VBQuery = await VBView.selectRecordsAsync(); let VBRecords = VBQuery.records
Hello all and thanks in advance for your help! I’m trying to pull records into my base from this API (https://clarisa.cgiar.org/swagger/generalListReference.html#section1-item4), but am stuck on exactly where to start. I’ve tried modifying other scripts and using the script app, also tried data fetcher. Any tips on how to get started would be appreciated.
I am running into some trouble when using the API to return entries which contain a user’s role, and in my case each user has multiple roles (ex. pitcher, left_fielder). Each user’s role is stored using comma separated values in a separate Airtable table (i.e. a “multiple select” table). I am currently using this filterByFormula call via API: FIND(“USER_ROLES”, role) > 0 It only seems to return results if the user has one role [FIND(“pitcher”, role) > 0], but fails when searching multiple roles [FIND(“pitcher, left_fielder”, role) > 0]. There’s got to be a way to have the API return records that “contain” one or all of the multiple select fields. Does anyone know how I can return results using a string of user roles via one filterByFormula call?
// updates the Deal table let tDeals = base.getTable(‘Deals’); let qDeals = await tDeals.selectRecordsAsync(); for (let rDeals of qDeals.records){ let d= getDistanceFromLatLonInKm(rDeals.getCellValue(‘Latitide’),rDeals.getCellValue(‘Longitude’),rDeals.getCellValue(‘BLa’),rDeals.getCellValue(‘BLong’)); await tDeals.updateRecordAsync(rDeals.id, {‘Distance’ : d}) } // distance between 2 given points (in miles) function getDistanceFromLatLonInKm(lat1,lon1,lat2,lon2) { var R = 3958.75586579; // Radius of the earth in miles var dLat = deg2rad(lat2-lat1); // deg2rad below var dLon = deg2rad(lon2-lon1); var a = Math.sin(dLat/2) * Math.sin(dLat/2) + Math.cos(deg2rad(lat1)) * Math.cos(deg2rad(lat2)) * Math.sin(dLon/2) * Math.sin(dLon/2) ; var c = 2 * Math.atan2(Math.sqrt(a), Math.sqrt(1-a)); var d = R * c; // Distance in miles return d; } function deg2rad(deg) { return deg * (Math.PI/180) }
I’m looking to pull data from an external API with different parameters. These parameters are coming from Typeform survey responses integrated to Airtable. Is there a way to execute the Get request by inputting the parameters from Airtable and then retrieving the results back into Airtable?
Hello amazing community! We pull data from AT into our WP website. We have added a hyperlink to a rich text enabled Long Text field. When the info is pulled into our website, the hyperlink is converted to a “****” snapshot here: Any thoughts? Thank you! Katherine
Hi, I’m developing an App for android and I want to consult the information on my base but the app will be used for many users (about 1000) so my question is if the rate limit is by IP or how it works? can I use airTable for this porpuse ? Thanks!
Hi, I have a table and form associated with it. When ever a user fills a form a row is created in the table. I have created a field Point of Contact(single select field)(4 no.s). I am looking at automation or scripts which can work as when ever new record/row ois created in the table POC(out of 4 any one) is assigned cyclic for each row. Please help in automation or script.
I am trying to do a curl command where I filter results from a linked table that has multiple linked records… I have the record ID for the linked table record. Tried some encoded filterbyformula variations but get zero results. linked field name is “sections”. I tried this most recently: filterByFormula=FIND(%22rec0nTsg5N5p1i5Pv%22%2C+%7Bsections%7D) Thanks for help.
Hello! My goal would be to automatically add photos from Table 2 (where they are imported in bulk) to Table 1 (with the right item order). The only link between the items in the two tables is a code/name column. I tried my best experimenting with formulas in Airtable and GSheet, but I couldn’t find any solution. I copied a script from an older community topic: Programmatically copy images from one table to another , but it doesn’t seem to work. Can someone please help figure out what the problem might be, or offer another solution? Here’s a simple version of my base (Restaurant): https://airtable.com/invite/l?inviteId=invyOwrzT6i00qbss&inviteToken=1c708dfb92651fb230f375f758d4d172ad56602b0347fccf8ac86f495d5a8522 , where the pasta dishes (Menu Item Name) should get the photos in the Attachments column from the Image column in Table 2, connected by the Name and Code columns. Thank you!
I am trying to duplicate a row from one table to another (using scripts). The table I am copying from has a column with “rating” type field in it. How do I go about duplicating in the createRecordAsync script? I tried something like let table1 = base.getTable("Table1"); let table2 = base.getTable("Table2"); let table1Rec = await table1.selectRecordsAsync(); await table2.createRecordAsync({ "Memo":[{icon: "star",max:table1Rec.getCellValue("Memo"),color:"yellow"}] } I got an error. Summarizing it: “(property) “Memo”?: 0 | 1 | 2 | 3 | 4 | 5 Type ‘{ icon: string; max: number; color: string; }’ is not assignable to type ‘0 | 1 | 2 | 3 | 4 | 5’. Type ‘{ icon: string; max: number; color: string; }’ is not assignable to type ‘5’.(2322)”
I am using Airtable as the backend for my hiring assessment app (a cybersecurity hiring test). As I understand it, Airtable’s API uses bearer authentication. I’m trying to integrate my app with Greenhouse.io, an applicant tracking system. Greenhouse’s API uses basic authentication. The way it works is this: Our customer, which uses Greenhouse to manage its hiring process, gets a list of tests (assessments) from us with a GET call. Customer chooses which test they’d like a particular candidate to take, and gives us the details with a POST call. We send the test to the candidate. We let the customer know when the assessment is complete with a PATCH call. Customer gets the assessment results from us using a GET call. Is there a no code/low code way for me to integrate with the Greenhouse API even though they use a different authentication method?
I’m trying to create my first app with the functionality to copy records from 1 table to another. I have been following examples here on the Record Picker and Spreadsheet importer: Airtable Scripting I run into the error: /Users/dev/.nvm/versions/node/v14.15.0/lib/node_modules/@airtable/blocks-cli/transpiled/src/builder/frontend/index.js: 'await' is only allowed within async functions (9:15) If I remove await commands, then I run into: ReferenceError: base is not defined at HelloWorldApp (https://localhost:9000/__runFrame/bundle.js:59:21) at renderWithHooks (https://localhost:9000/__runFrame/bundle.js:59844:18) at mountIndeterminateComponent (https://localhost:9000/__runFrame/bundle.js:62524:13) at beginWork (https://localhost:9000/__runFrame/bundle.js:63648:16) at HTMLUnknownElement.callCallback (https://localhost:9000/__runFrame/bundle.js:45207:14) at HTMLUnknownElement.e._wrapped (https://cdnjs.cloudflare.com/ajax/libs/rollbar.js/1.9.0/rollbar.nojson.min.js:1:13806) at Object.invoke
Hi, I want to allow a customer of mine to export the data on AirTable. I figured that if the customer put the API key, my program can do the rest, specifically: create a table with specific fields put the data in As far as I understood point 2 is easy but point 1 is impossible with current set of API. Is that true? PS: I noticed that there is a way to create a table using the Airtable Blocks API but is that only for frontend apps? Or can I work with them on a NodeJS instance?
We are trying to access a specific cell value in the code. We are able to query the records and getCellValueAsString. However when we try to call a specific record from a field we get a completely different record from that field and there seems to be no pattern to it. let table = base.getTable("🌻 Groups"); let queryResult = await table.selectRecordsAsync(); let record = queryResult.records[1]; console.log(record.getCellValueAsString("This Record 🆔")); console.log(record);`Preformatted text` As you can see we are trying to get the first record in the list, but we actual get the 27th and if we increment the value to the second, we may end up getting the 35th record. However all of the fields within the row that is selected is present. The reason we want to do it is because we want to update a linked record to a cell while leaving the previously linked records intact.
Hello, I use this script for move record from table 1 to table 2, All data is moved except data of type dropdown list (Ville). I show this error: Can’t create records: invalid cell value for field ‘Ville’. Could not find a choice with that ID or name let table1 = base.getTable("DATA"); let table2 = base.getTable("Con"); let result = await table1.selectRecordsAsync(); for (let record of result.records) { if (record.getCellValue("Prét")) { await table2.createRecordsAsync([ { fields: { 'ID': record.getCellValue("ID"), 'Source': record.getCellValue("Source"), 'Agent': record.getCellValue("Agent"), 'Nom complet': record.getCellValue("Nom complet"), 'Téléphone': record.getCellValue("Téléphone"), 'Ville': record.getCellValue("Ville"), 'Prét': record.getCellValue("Prét") }, } ]);
Is there a way to reset an input field? Say someone pulls up a record selection input and then they click off so nothing is selected the user is no longer able to go back and select something different. As far as I know you can’t reset the input, remove the element and re-add it to let the user try again. I tried using a do while loop so that it could do the input instruction again if the variable is null. If it isn’t possible to reset the input or remove the element and re-add another input, is there a way to re-run the script with a button or some other event?
Hi I create new records in Airtable via the API with integromat. As part of the payload I send a id which is numerical, however when I receive the response back from airtable, the id is displayed as alphanumeric. The same happens when I send an api request for records, the id is also displayed as alphanumeric - I have to see the id as a number Please assist Thanks Jaco
Hi guys, I am just starting with the scripting and I am really trying my best. I have learned a lot just by trying out different submissions from the community and by doing that I understand how a script is structured etc. I am currently focused on 3 specific scripts that was contributed to this community. The first one is automatically setting up a field from a table to link all records from a view based on another table. It worked. let mstTable = base.getTable('$MST'); let mstView = base.getTable('$MST').getView('TEST'); let mstQuery = await mstView.selectRecordsAsync(); let mstRecords = mstQuery.records; let invsumTable = base.getTable('$INV: SUM'); let invsumQuery = await invsumTable.selectRecordsAsync(); let invsumRecords = invsumQuery.records; let d = [] invsumRecords.forEach(c => d.push({id: [c.id](http://c.id/)})); let updateRecords = mstRecords.map(c=> ({id:c.id,fields:{'$INV: SUM': d}})); while (updateRecords.length > 0) { await mstTable.updateRecordsAsync(updateR
I get to the Blocks install step and receive this error(I am using a mac OS with the npm V14). I was uncertain if there was a configuration or setting that I missed. Initializing block using https://github.com/Airtable/apps-hello-world template … :x: Something failed! Cleaning up… :x: Error: TAR_BAD_ARCHIVE: Unrecognized archive format
Hi there, we run our school’s school information system (SIS) on Airtable. Our faculty and staff have a daily schedule that is fairly consistent from workweek to workweek, but does include some variation. I want to the ability to copy a week’s worth of events from one week to the next, at which point I can make micro adjustments where needed. It’s far too cumbersome to individually copy every event, every day, and then adjust both the start and end (time) fields on every single record. I assume a scripting solution here is the right direction to head, but, being very new to this feature, I wonder if others with more experience would agree. In essence, i’m attempting to mimic the features of some of the most popular employee-scheduling apps (e.g. Sling — getsling.com/employee-scheduling). My setup is essentially this: Table called “Calendar” Date and time field called “Start” Date and time field called “End” Several other fields specific to our organization Grid view Calendar view For
Can a script link a record in TABLE A to the matching records (via email addresses) in multiple tables TABLE B, TABLE C, TABLE D, etc in one go or does each one have to be its own scripting app? Thanks!
Hi there :slightly_smiling_face: I want to copy certain fields of a record to another table. Example: table 1 has 3 fields with names: 1,2,3 table 2 has 4 fields with names: 1,3,4,5 When the script is run, all records of table 1 should be copied to table 2 into fields 1 and 3 (leaving fields 4 and 5 empty). Could you give me some direction as to what should go into the bold section? What I have so far: let table1 = base.getTable(‘Table 1’); let table2 = base.getTable(‘Table 2’); let copyQuery = await table1.selectRecordsAsync(); for (let record of copyQuery.records){ table2.createRecordsAsync([ { //what should be here } ]); };
I see in another post that it’s possible to create tables and fields via Apps (aka blocks). However, it’s not possible to create Formula, Link, Rollup, Lookup, and Filter fields. This would really be helpful to my use case. For example, I have a base that manages my finances. A few of the columns have formulas and rollups that are filtered for only including December transactions. When January comes, I would want to click a button that either creates these same columns filtered for January transactions or updates the previous columns.
I’m trying to do the following: filter records in the table by a cell number AND by whether a cell says “voicemail” or “text message” - so I want to find records that match the cell number and where the VMorText cell is “text message”. Cell type is computed (problem 1) After that - find the record that was created first in the resulting array (problem 2) Part of the script below // getting ID for new record let config = input.config(); let TxtrecordID = config.TxtRecordID; let Txtcellnumber = config.TxtCellnumber; // get cell number let Txtsearchfield = await Txttable.getField('Cell number'); // define search area as Ticket table let Txtsearcharea = await Txttable.selectRecordsAsync() // list records that match cell number - problem 1 let matchingTxtRecords = Txtsearcharea.records.filter(cellnumber => { return cellnumber.getCellValueAsString(Txtsearchfield).includes(config.TxtCellnumber) }) // try to select first record from array - problem 2 let firstTxtrecord = matchingTxtR
Already have an account? Login
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.