Need development and API help? Ask your questions here!
Recently active
Hello! A very belated happy new year, and thank you for participating in the custom blocks beta! We’re excited to share the newest updates to the SDK, CLI and documentation. One thing before we dive in: we’re looking to feature YOU when we announce custom blocks to the world. As one of our early custom block developers, we’d love to extend an opportunity to highlight a block you built. Please fill out this form by March 9 to be considered. All selected block developers will receive $1,000 worth of Airtable credits! Blocks SDK updates :mouse: We’ve updated Cursor with several new features: the ability to set the current table and view with setActiveTable() and setActiveView() , and the ability to watch and read the currently selected field ids with selectedFieldIds . We’ve also made a convenience update to our record hooks ( useRecords , useRecordIds , useRecordById ): they can now accept a Table , View , or QueryResult as previously supported. We’ve updated the YouTube
Doing some simple substring removal and getting different results from the block than in JS Bin. let renderName = "MX_Topo-Chico-Agua_Mineral-Water_600ml_PET_6x"; let secondaryQuantity = "6x"; // scripting block generates an UNEXPECTED output: "MXTopo-Chico-Agua_Mineral-Water_600ml_PET" output.text( removeSubString(renderName,secondaryQuantity) ); // JS Bin, however, outputs as EXPECTED: "MX_Topo-Chico-Agua_Mineral-Water_600ml_PET_" // console.log( removeSubString(renderName,secondaryQuantity) ); function removeSubString(str,substr) { return str.replace(substr,""); } Oddly, making use of a character (rather than “”) yields proper results. renderName.replace(secondaryQuantity,"1") => "MX_Topo-Chico-Agua_Mineral-Water_600ml_PET_1"
If everyone used a similar schema for base/table schemas, it might help with tool integrations in the future. Here is my initial take: Script: Meta Definition Show and tell Something very often requested is the ability to extract the meta information of a base/table to be used for external use. Now, with the new scripting block, that information can be extracted and shared outside. Simply copy this code into a scripting block and run it. If you wish to publish to a 3rd party endpoint, simply modify the codebase. Full documentation provided inside the code.
Hello Airtable Community! We’re inspired by the example scripts you’ve started to build in the scripting beta, and we’d love to see more of them! To that end, we’ll be hosting a series of challenges over the course of the beta - with fun prizes ready for the creators of the best scripts :tada: First up: Script Remix Challenge. Remix one of our sample scripts to share with the community, submit it, and we’ll highlight and reward the best of the bunch. You may have noticed that we provide a few examples directly in the scripting block. They’re a great starting place- but we know you can use them as a foundation to create something even cooler. Maybe it’s applying the basic concept to a specific use case! Maybe it’s adding more features or functionality! Interpret ‘remix’ as creatively as you like Here’s what you need to know: Create a base with your custom remixed script in the scripting block (beta) and post in here in the community forum for consideration! We recommend publishing th
Since the script doesn’t support a {cast:true} feature, I had to create my own function. I figure this is a pretty common use case so easier for all to use similar formula: gist.github.com https://gist.github.com/on2air/97ee258d88490daa31af55940867b385 On2Air: Common Functions /***** * Title: Common Functions for Scripting * License: MIT * Author: Openside (Team behind On2Air products and BuiltOnAir community) * Sites: * https://openside.com - Openside Consulting Services * https://openside.com/#products - On2Air Products * https://builtonair.com - All things Airtable Community * * Reach out for all your Airtable needs This file has been truncated. show original Also, a function to retrieve the collaboratorID based on an email.
Hi, I’m just getting started with the scripting block, trying a few examples out. When I hit the “copy” button on an example and try to paste the code into the editor window, I can’t find the expected “paste” menu. CNTRL V works, however. I’m using Chrome on Windows 10.
AirTable team: I’m not finding enough info in the documentation to know quite how to link records. I have a Contacts table and an Organisations table in my base. I want to find an organisation and link the a contact to it. I’m guessing the way to do this is to firstly find the record ID of the organisation (through iterating through the result of myOrganisationsTable.selectRecordsAsync() ) and use this to set the corresponding field in my contacts table? Do I need to do the same thing the other way round too - so add the contact ID to the Contacts field in my Organisations table? Some code examples along these lines would be good…
Hey, Would love to have a notification component, similar to the black ‘Undoing last action’ and ‘Record moved to trash’ notification you get in the primary Airtable UI. One that slides in and disappears automatically. Cheers, Ronen Superblocks.at
Running an example script from the Scripting block docs inside the Airtable Electron app (on Windows) generates an error. Running the same script in a browser view of Airtable (in my case: Firefox) works as expected.
I am working on an Alexa skill that executes a GET from an Airtable base where the record contains a field whose field type is Attachment. The GET in the Alexa skill assigns whatever is passed from Airtable to a variable. I don’t have a means of displaying the Alexa variable to see the contents. From the API documentation, I understand an attachment field will pass a field ID, the URL of the object and the file name of the object. Could someone provide an example of what is passed from the API using the following example: AudioField=api_response.records.0.fields.AirtableAudioFile; After execution, what is the contents of AudioField? Audiofield = ‘xxxxyyyyzzzz’ Thanks in advance for your reply!
There’s been a few recent posts about using fetch() in the new scripting block. Here’s another question/use case that’s not currently working for me. My office uses Airtable for, among other things, tracking course videos through the editing process. Videos are hosted on Vimeo and one task we do is pull in the latest runtime. This can be done easiest through Vimeo’s oEmbed API which includes a “duration” field that provides the length of a video in seconds. The problem: our videos are private and accessible through (able to be embedded on) a small whitelist of domains. Using the “old” API, this worked as I could set the referrer to our domain (the code was written in NodeJS and called the https.get() method). I’ve tried adding “airtable.com” and “api.airtable.com” to the video whitelist, but it still returns a 403 error. Some initial searches indicate this might be a CORS issue with fetch() and it may not include the right options to make the request? Or it could be a bug in the script
Hey, I’ve been looking on all the sample blocks, but couldn’t find an example of how to use the watch / unwatch functionality in a fine grained matter. Specifically, do I need to call unwatch to cleanup after I call watch and if yes, use react useEffect to do that? I don’t want to call useWatchable, because then I have to store a copy of the watchable key value in useState and compare new watchable value to current value in state and it seems like overkill. My use case involves tracking the cursor.activeViewId. Thanks, Ronen
Hey everyone! Trying to figure how to to get data from MongoDB to Airtable. Out of all the connectors/automators, Parabola seems to be the one to do the trick. However, on the final “API Export” step I am running into difficulties. I am non-CS, so maybe I am missing something super silly :grinning_face_with_sweat: Parabola asks for the following: Request Type API Endpoint URL Body Max Requests per minutes Authentication Type Bearer Token Here’s what I did: Opened the Airtable API page for the corresponding base. Copied the Endpoint URL from the top of the cURL interface Copied the snippet of code starting after "fields": into the Body { "User ID": "{id}", "First Name": "{first}", "Last Name": "{last}", "Email": "{email}", "Business ID": [ "{business}" ] } Inserted the Parabola values with {} (all strings) Found my API key and put that into the Bearer Token Testing things in Parabola works. However, when I publish the flow and run it, I get a 422
In my data science work, I often need to find outliers. There are many ways to do this and one might think it can be done reliably using a simple filter - e.g., Show me anything that falls outside this range. This assumes (a) you know the correct range of outliers, and (b) the context for the range is never likely to change. In practice, your data will prove you wrong about these assumptions time and time-again. In cases where transaction flow is small, a quick scan will usually suffice to see if your data passes the sniff-test. But when you have many thousands of records and dozens of fields to consider, you might want to audit your data with powerful statistical analysis. Ideally, you need a process that can learn based on all of the data available and apply its rules consistently, even when you’re not in the room. To that end, here’s a script block that uses the multiple interquartile methodology to find outliers. Once again, this is a pretty good use of a Script Block because doi
Hi, I’m tryin to do api-request with “filterByFormula”. I want to filter by date and to filter by range. I tried something like that, but it doenst work (Gettin no records): AND((DATUM) >= “02-01-2020”, (DATUM) <= “02-31-2020”) How do i have to implement this kind of filter? Thanks for your help!
Hi - not sure if I’m doing something odd here, but I cannot get fetch to work in the Scripting block. Getting this: cannot find name ‘fetch’ Normally, I would think this is my user error, but I have another base using the “original” pre-beta version (2 weeks ago) and fetch works OK in this. Any thoughts @Kasra ? Thanks JB
Hey there, Is there a way to get the block id at runtime? I need it for authorization purposes, to see if my customer is still authorized to use the block. Thanks, Ronen Babayoff Superblocks.at
This script block code seems to crash the Block… any ideas? output.text('# IndexOf() Bug?'); let str = "This is a test ..."; let positionOfIs = str.indexOf("is"); output.text(positionOfIs);
There’s a saying in NASCAR, although the origin is largely unknown, really fast cars are often described as “stupid fast”. In my early and limited experience with the Script Block, I’ve noticed that barebones reading and enumeration of data sets are exceedingly fast - indeed, stupid fast. This is great news - the team at Airtable cared greatly about the performance in script block apps when accessing and processing large numbers of records with potentially numerous fields. I think there’s a little magic going on inside this new feature which, in my experience, is quite impressive. Writing data - updates to a field - not so fast. But this could be my poor design choices. I haven’t spent any time thinking about field and record updates thus far. Here’s the base I used for these tests. It includes a quick-and-dirty benchmark block. I’m curious if these performance results vary by client.
Hi, Airtable Scripting Block Documentation wrote: " In your script, you can use anything from the JavaScript standard library, except for DOM APIs that interact with HTML on the page." Suggestion: In place of DOM API that is not the right way to do it, could you open any other way you should prefer like passing States to Props to UI Components ? Best, oLπ
From people’s experiments so far, are we seeing Scripting as an alternative to third-party automation like Zapier? I suppose by that I’m talking most simply about Airtable > Airtable automation.
Less than a few hours after Airtable released its long-awaited integrated scripting block, I was asked by more than one community member what I thought about this new shiny toy. By looking only at one example by @JonathanBowen, I am able to say – This toy has teeth! I needn’t write a single line of code to recognize a game-changer for Airtable users, and specifically, consultants, power-users, and anyone interested in taking their solutions to a higher level. Certainly, there are bound to be a lot of missing elements of this integral tool to manipulate data in tables. And there will be significant complaints about the tight guard rails imposed to prevent “coders” from doing dumb things on a platform that is ostensibly hosted for joint tenants-in-common. Teeth? Yes, teeth. This early implementation can put a huge dent in many of the common deficiencies of the beloved Airtable that this community has railed about for almost a half-decade. This new block will ultimately demonstrate tha
Is there a way to lock fields in a record that are updated through the API? Use case: We use the API to update the airtable according to certain parameters on our company servers/backend. These fields ideally need to be locked as the scripts on the backend/server side does searches for these fields and if they are accidentally changed the endpoint s missed.
Hey everyone, I am trying to write a script that call my airtable and “Pending” orders. I need to write a json script that calls to the server, retrieves any orders and makes them into seperate windows so you can see them like tickets. (i was going to include the airtable to show but it will not allow me to add link) It has name - what drink they want - what the status is - the time it was created. I’ve messed round with the airtable API but it doesn’t allow me to retrieve the information I want and throws them into a long line. To be honest I am not a programmer at all, I dwabble a bit and try to get things to work but out of my element on this one. Any help would be greatly appreciated. Thanks, Bobby
Hey, would love to be able to not only get the cursor.selectedRecordIds, but also the selected fields, if any fields are selected in a grid view. Seems like there will be many use cases that would require such functionality. I personally have a few. Thanks, Ronen
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.