Need development and API help? Ask your questions here!
Recently active
I’m looking for a simple script that I can add to a base that when run, manually triggers an automation I’ve set up that is turned on. For background into, I’ve created an automation that works, but the automation will only apply to future record updates. Is there a way to run a script that triggers my new automation to run manually and update all records that match?
Hey Airtable community, I am having trouble automating a script that triggers when the quantity field is updated of a new record. The trigger action is that a record is inserted into another table (Inventory Quantities) with the id of the current table (Products) and quantity set to 0. I had no issues when I set the field type of Product ID to number, but when I switched it to a linked record thats when the trouble started. Please find the code below as per suggestions and documentation on how to handle linked records: let ProductsTable = base.getTable("Products"); let QuantityTable = base.getTable("Inventory Quantities"); let query = await ProductsTable.selectRecordsAsync({ sorts: [ {field: "Product ID"}, ] }); let record = query.records[query.records.length-1]; let productID = record.getCellValue("Product ID") + ''; let newRecord = await QuantityTable.createRecordAsync({ "Product": [{id: productID }], "Quantity": 0 }) This code throws Field “Pro
So, basically. Using the .NET api, when I create a record in a table, I can see it when I open my airtable table in the browser but when looking after it using the API (by Id, or searching a field) I can’t find them. Thanks in advance.
I’ve been trying to automate the deletion of sensitive data when a record comes into a certain view or meets certain conditions. No success so far… There are 2 obstacles (to my limited abilities in this field): Only a few cells need to be deleted, not the whole record. The deleted cells are attachments, so it won’t work to update a record with an empty cell. I’ve tried, but the attachments remain where they are, even though the tests run successfully. I’ve read a bit about scripting, but this is beyond my understanding. Does anyone know a way to achieve this, even for a noob as myself? TIA!
Hello, I am currently trying to to have cell A1 (Barcode Cell) autofill a linked cell B1 (Pallet #) based on a script. I would think its a simple “copy/paste text” situation, but that is not the case. Would anyone be able to figure this one out?
Greetings! :wave: I am a newbie here and have just started to explore Airtable! I have got a requirement to have a dynamic table which includes the alerts and a few metrics from google cloud monitoring, Is it possible to have such a thing built using Airtable scripting? Appreciate if someone could share some thoughts/suggestions on this. Thanks!
Hi! We’ve released a new version of the SDK, 0.0.46, which contains three new functions: base.unstable_createTableAsync() Creates a new table in the base with specified name and fields table.unstable_createFieldAsync() Creates a new field in the table with specified name, field type, and field options field.unstable_updateOptionsAsync() Updates the options of a field (e.g. adding or renaming choices in a SELECT field) Refer to FieldType for the write format for field options for each field type, and the documentation for each function (linked above) for specific usage details, quirks and example code snippets. (Note: we’re aware of some formatting issues in the FieldType docs and will update them shortly!) These methods have an unstable_ prefix as several field types are not supported at this time (formulaic and linked record types: see FieldType for full details) and we anticipate we may need to tweak the API before releasing them as stable. The prefix will be removed in
Hello! I’m attempting to dynamically pass data through an API with the utilization of an Airtable button that triggers a ‘Run Script’ Automation. Essentially, the script will take the email of the record which triggered the automation, pass it through the API and the rest is covered. My biggest challenge is that I need to encode the email value in the API URL, however, I cannot figure out a way to modify the ‘readonly’ attribute of the input variable I’m attempting to use in this case. Anyone know of a method to bypass the ‘readonly’ attribute? Or if you have a different solution to get the records email in the script, I’m all ears! Code for reference: let email = input.config(); var encodedEmail = encodeURIComponent(email); fetch(“https://api.sendinblue.com/v3/contacts/” + encodedEmail + “”, options)
I have a database with many places and their coordinates and I’m looking for a script to know all the places within x kilometers from one place. Do you know if this is possible with Airtable? Thanks in advance. Thibaud -
Hi, I’d like to delete a record when a checkbox is selected. I’ve set up the automation but have zero knowledge of scripts. What is missing here? let table = base.getTable("Room Reservations"); let inputConfig = input.config(); let recordId = inputConfig['recordId'] await table.deleteRecordAsync(recordId);``` Thanks so much
Hi guys I hope some of you scripting geniuses can help me. I have a button In a task list and want to add a button to add a new row in that list under that project instead of clicking the “plus sign” underneath the row. Can someone help me with the script? Sinve I have the button and record picker script we know what row we’re at so to add a row/task shouldn’t be so complicated? But its complicated for me… The script look like this know : // Change this name to use a different table let table = base.getTable(“Tasks”); // 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’, table); if (record) { // Customize this section to handle the selected record // You can use record.getCellValue(“Field name”) to access // cell values from the record output.text(You selected this record: ${record.name}); } else { output.text(‘No record was selected’); } Much appreciate
Hello! I’m trying to edit a script that I already have. To do so, I need to be able to get values from a Link to Another Record. The linked record is on a different table. I’ve been using .getCellValue() for most cases, but it doesn’t seem to be helping me here. Right now, when I run the .getCellValue, it returns an Object, and when I run .getCellValue().values, it outputs “function”. How can I get a specific field off of the linked record?
I’m trying to figure out a formula for listing records that have have a linked field with the Record For Example if i have a Post Table with a Customer field that is an Array of customer Id’s such as [‘rec23jia’, ‘rec234i’], I would like to get this record back if the Customer Array field contains the value rec234i Heres my thought SEARCH(‘rec234’, ARRAYJOIN({Customer}, ’ ')) but this doesn’t seem to be working. When i do the opposite SEARCH(ARRAYJOIN({Customer}, ’ '), ‘rec234’), i actually get undefined values, so it’s almost as if the ARRAYJOIN function isn’t doing what i think it’s doing.
Say I need to get 5, 10, or 50 records, and I have their record_ids. Is this style of syntax a bad idea? { filterByFormula: "OR(RECORD_ID() = 'reca9IDlX0gvu32ml', RECORD_ID() = 'recgh3XeMcdmX8uPj', RECORD_ID() = 'reczBZBWZG06DOsCO', RECORD_ID() = 'recXvnMcZKmxyBtUi')" } I’m generating the innards of the OR with code. Thanks in advance.
Happy new year! Modulartable is a project I’ve been working on since the second half of 2020; originally inspired by chatter on these very boards (e.g. Blockchaining) and wanting to do my very own JavaScript pilgrimage of reinventing the wheel just one more time because I’m sure mine will be rounder. The goal being native and systemic support for Airtable script modularization. Background I really liked the Scripting App since its beta Block days. Not least because the environment is much faster than even most paid coding repositories (I’ve tried them all while moving apartments this year, some are downright terrible. But the fact that it’s joined with a modern relational database opens up some wonderful possibilities. All in all, I wanted to do more. But what little I did know of frontend got rounder and wheelier about a dozen times since I last took a jab at it. That’s how I started researching ways in which to emulate — and, eventually, implement — full-featured Airtable modularity
I was wondering if anyone here has managed to write a piece of code in the scripting block to Resize an existing attachment file to match certain dimensions programmatically Obtain the pixel dimensions (height and width) of a image attachment and most interestingly Call Google Vision to run Image Analytics on a image attachment, pulling the results into a text or linked field in Airtable… Cheers, Martin
Hi, I’m learning how to use the scripting block, not too successfully. I have tried to adapt the scripting block “select a record” and one from the thread about linked fields from @capt & @JonathanBowen but I can’t seem to get it to work. I am trying to copy the text output by a formula field (EQ3) into the text field Notes using a button. Any help or advice would be much appreciated! Many thanks, Alastair This is what I have so far: // Name of table let table = base.getTable("Requisitions"); // This script is run from a button field & will use the button's record let record = await input.recordAsync('Select a record to use', table); if (record) { // You can use record.getCellValue("Field name") to access let oldValue = record.getCellValue("EQ3"); let newValue = oldValue; output.text(newValue); table.updateRecordAsync(record,{"Notes": newValue}); } else { output.text('No record was selected'); }
Hello I would like to speak with a Airtable API developper to get product information from 1Worldsync API. Is there a list of API developpers using Airtable or can you recommend someone? Thanks
I am able to use the API to obtain URLS for images. I can access those URLs from my browser when logged in. However, my API is unable to access the images when using a GET (I am sending the authorization token header): <?xml version="1.0" encoding="UTF-8"?> <Error><Code>AccessDenied</Code><Message>Access Denied</Message><RequestId>XXXXXXXX</RequestId><HostId>YYYYYYYYYY=</HostId></Error> HTTP/1.1 403 Forbidden Content-Type: application/xml Transfer-Encoding: chunked Connection: keep-alive Date: Fri, 14 Jan 2022 02:36:39 GMT Server: AmazonS3 Content-Security-Policy: default-src 'none'; style-src 'unsafe-inline'; img-src https://*/favicon.ico; sandbox Access-Control-Allow-Origin: * X-Robots-Tag: none X-Xss-Protection: 1; mode=block X-Content-Type-Options: nosniff Referrer-Policy: no-referrer X-Cache: Error from cloudfront Via: 1.1 61e47cd082bb04a8fb8ae61dd54f6b32.cloudfront.net (CloudFront) X-Amz-Cf-Pop: SFO5-P1 X-Amz-Cf
Hello all, I have been messing around with the API and PHP to try and display a list of records. I have been sort of successful in retrieving records but when it is linked to another table it just shows the Record ID instead of the value from the other table. Anyway around this? For instance in the code below $model is returned as the Record ID instead of the Model Name. if ( array_key_exists ( 'Model', $fields ) ) { echo '<h2>Model</h2>'; echo '<ul>'; foreach ( $fields[ 'Model' ] as $model ) { echo '<li>' . $model . '</li>'; } echo '</ul>'; } Thanks.
Hello, I understand that there are some limits to update records in a table but I cannot find a execution time limit in the documentation or this forum for custom Apps. In my case I would like to update all records of a table so I’ll have to pace the calls to updateRecordsAsync. But I also need to fetch data to an API endpoint with some quota too (in our example 50 / seconds) so the update process overall might take a long time depending on the table size. Taking some margin this operation (fetch data and update record for 5K records) could take ~150s. Will it be a problem ? Thank you in advance for your help Best regards
I have a script that I run through an automation but sometimes also want to run manually. Ideally, I’d like to use the exact same code in both so I don’t have to maintain two scripts. However, the API seems to behave differently in the two environments. Using this exact same code block: let myTable = base.getTable('Some Table'); let query = await myTable.selectRecordsAsync(); for (let record of query.records){ let val = query.records.map(record => { let vals = record.getCellValue("Linked Stuff"); // this field references another table console.log(vals); // ... the rest doesn't matter return 1 // some kind of sum over the records in vals, etc. } } the log statement shows that in the scripting block, “vals” is an array of objects: However, the same code run in an automation (debug view) produces an array of strings in that variable: Is this a temporary bug? Which behaviour should I expect in general? I can work around this for now but of co
There’s no API call for exporting a table as CSV right? (couldn’t find it in API documentation) Has anyone written a script that mimic that functionality by iterating through all the records, replacing linked record IDs with names, and then, generating said CSV? If not, I’ll work on writing one…
My goal is to send an email to every (50+) people every month that reminds them to submit timesheets. I tried to set this up in Zapier, however Zapier will not run the same row twice… #fail. So I set up an Integromat account, however Integromat requires a Last Modified Time as a trigger, so unless a row has a modification I have no way to trigger it for an email… I’m kind of perplexed on how to do something very simple…
hey everyone, I’m not sure why but I’m getting an empty result when using filterbyformula with a date function. I’m trying to receive all records that hold a certain date in a certain field. The field also might be empty on some records just if that matters, but I double checked there are records for these fields. Here’s my query… GET https://api.airtable.com/v0/appXYZ/Bestellungen?fields%5B%5D=Datum%20Abb.&fields%5B%5D=SU%20Beleg&filterByFormula=IS_SAME(%22Datum%20Abb.%22,%222021-12-20%22)&view=Buchhaltung%20Online%20DE So i’m doing filterByFormula with "IS_SAME(“Datum Abb.”, “2021-12-06”) I tried IS_AFTER and IS_BEFORE also to double check and even have more records to show but all I get is an empty result. I tried using other formulas on others fields that worked fine but I can’t get this to work. Am I overlooking something? Is the space in the field name causing any issues here? I mean it is URL encoded correctly but i’m still not sure if it could be an issue. I can’t s
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.