Need development and API help? Ask your questions here!
Recently active
I have a table, and I made a view with some grouping. The schema of the table is [Survey, Question, Category, Person, Response] Now I want to be able to extract the table with those groups and summary statistics and use that elsewhere in another part of my workflow, outside Airtable. The API allows filtering, but not grouping it seems. How does one accomplish this? Another option is somehow I can make the summary statistics into their own view/table? so it would look like [Survey, Category, Average Response]? Then I can query for that table and read those records and use them where I need them. smiles
Hello everyone, I’ve been trying to use Airtable as a social media content planner for weeks now, and realizing this is pretty much one of the first use cases everyone thinks about when learning of automations. I finally reached a solution that works, although an experienced user might object that it is far from perfect in terms of optimization/number of runs. I wanted to detail it here, to help any new user create their own planner, and hopefully to centralize tips and tricks and to get improvement advice from experience users ! Speaking of this, thank you so much @ScottWorld and @Justin_Barrett for your many posts all over the place, that helped a lot. Before we continue, please keep in mind that this is the first time I’m using Integromat :winking_face: Again, I’m eager to see your advice if I’m doing something wrong ! First of all, I’m using Integromat’s default template for social media as a base for this project. The whole thing is pretty comprehensive, and I would recommend to
Hi, how can I make Airtable an “approved” app so I can create automated records via Zapier? I’ve finished the zap in Zapier but I get the following message (screenshot) Any help is greatly appreciated. Thanks!
i started an app and try to show table fields in my app i used a code from guides as axemple, but when i request fields by their names it shows as undefined, but field record.id is displayed ok i have table with wields Title, Price etc, but only record.id have value in app, but in table all fields have value my code import { initializeBlock, useBase, useRecords, } from '@airtable/blocks/ui'; import React from 'react'; function HelloWorldApp() { // YOUR CODE GOES HERE const base = useBase(); const table = base.getTableByName('events'); const records = useRecords(table); const events = records.map(record => { return ( <div key={record.id}> {record.Price || 'not named record'} </div> ); }); return ( <div>{events}</div> ); } initializeBlock(() => <HelloWorldApp />);
Hey guys, So I have an accumulated vacation table that uses an employees start date and a duration formula to determine how much vacation / sick time they have earned based on their years of service with us. What I would like to do is create an automation that is capable of creating a record for every “active” employee when the calendar year changes. This would essentially create 50 some records on 1/1/20xx detailing an employees accum. vacation and sick time. I have to have a record for each annual year becuase I use another table to track an employees attendance in regards to Birthday, vacation days, sick time used that subtracts hours used vs hours accumulated. Thanks for any tips in advance!
Hi This relates to this Topic This is the code I have: let repoT = base.getTable('Repo'); let sourceT = base.getTable('Source'); let record = await input.recordAsync('Pick a record', sourceT); // let name = record.getCellValue('Part 1') + '-' + record.getCellValue('Part 2'); if (!record.getCellValue('Repo')) { let name = record.getCellValue('Data'); // create the record in the repo table let newRepoRecord = await repoT.createRecordAsync({ 'Name': name }) // set variable for today's date let now = new Date().toLocaleDateString("en-GB"); //note that newRepoRecord is the record ID of the created record // see this by logging the result: console.log(newRepoRecord); // now take the newly created record ID // and set the linked field from this let updatedRecord = await sourceT.updateRecordAsync(record, { 'Repo': [{id: newRepoRecord}], 'Part Created': "Part Entered " + now }) } else { console.log("Repo
Hi there, I’ve found a javascript code to convert HEX codes to a name. However, as I am not a javascript coder, I need help to make changes to the code so that it works when i run it as a script in Airtable. Here is the link: https://www.w3schools.com/lib/w3color.js
Some of the users of my custom app are getting the “Sorry, an error occurred” message, but I can’t reproduce the problem on my computer when I follow the same steps-- is there some way for me to access, or else for them to send me more details of the error like you can see in development mode? Thanks!
Hi, I am trying to use a pagination in my code, but the airtable.js client always returns all results even if pageSize is used. Moreover, if I use pageSize it will query the data from airtable database one page at a time until it reads them all. How to stop this? I have intercepted the outgoing requests and these are the urls the client calls GET https://api.airtable.com/v0/applDJB1ThaWVcIJD/Moc%20Data?pageSize=2&maxRecords=5 GET https://api.airtable.com/v0/applDJB1ThaWVcIJD/Moc%20Data?pageSize=2&maxRecords=5&offset=itreHdPlZHyg9RWB3%2FrecBtmAdzmYqi9F8t GET https://api.airtable.com/v0/applDJB1ThaWVcIJD/Moc%20Data?pageSize=2&maxRecords=5&offset=itreHdPlZHyg9RWB3%2FrecENdiDVazobA9fH my code: async list<T extends TableNames>(baseId: AirtableBaseId, table: T, queryParams?: QueryParams<Tables[T]>): Promise<MetaTable<Tables[T]>[]> { return this.airtable .base(baseId)(table) .select(queryParams) // <- { maxRecords: 5, pageSize:
I’m still fairly new to scripting, and going through the learning process. I’m assuming the below error means that scripting can’t access the details that it needs to? Error N: Can’t set cell values: Field ‘Button’ is computed and cannot be set My example code below; let myTable = base.getTable("ButtonTable"); let myTabeQuery = await myTable.selectRecordsAsync(); for (let myRecord of myTabeQuery.records) { let getButton = myRecord.getCellValue('Button') console.log(getButton); let getSelect = myRecord.getCellValue('SingleSelect') console.log(getSelect); let newName = "💚"; await myTable.updateRecordAsync(myRecord,{Name:newName}); let newSelect = "💚"; await myTable.updateRecordAsync(myRecord,{"SingleSelect": {name:newSelect}}); let newButton = "On"; await myTable.updateRecordAsync(myRecord,{"Button": {Label:newButton}}); } Is there any method to update Labels?
I am using GET to retrieve data from a table in a base. Rather than getting all the records, I would like to get the records filtered by a view. My query looks something like this: https://api.airtable.com/v0/appXXXXXXXXX.../TheTableIWant?fields%5B%5D=FIELD1&fields%5B%5D=FIELD2_ETC What would the query look like to get a view?
Hi Everyone, I’ve been trying to script from the desktop Mac OS client. I believe it’s an electron app. Unfortunately, any time I try to open the scripting block, it just hangs there and continues showing the loading wheel. I can run scripts, but I cannot edit them, I only see the loading wheel. I saw this thread below: Scripting block does not work in Airtable Electron app Scripting app 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. [Scripting Block Error] My issue is similar, but I don’t get an error at all. Any tips on how to fix this? Thank you!
Below is the example code from https://airtable.com/api for listing records with Javascript. How should I adjust the code when my base have more than 100 records, and I want to run some code when all the records have been retrieved? (I know that I’ll have to remove “maxRecords: 3,”) If I put my code within “eachPage” but then the code will be executed multiple times (obviously). I’ve tried to put my code in inside an else statement within the done-function but then I don’t have access to the variables and methods like records, record, record.get and so on. var Airtable = require('airtable'); var base = new Airtable({apiKey: 'YOUR_API_KEY'}).base('appInTsFatECjqsT2'); base('Uppställningsplatser').select({ // Selecting the first 3 records in Alla uppställningsplatser: maxRecords: 3, view: "Alla uppställningsplatser" }).eachPage(function page(records, fetchNextPage) { // This function (`page`) will get called for each page of records. records.forEach(function(record)
Heya! I receive big bunches of links to images from clients. Links could lead anywhere, Airtable included. So I need to download them for further processing and as faster as possible. But when it comes to Airtable I meet some kind of a limit there (which I don’t meet, for example, with Google). So I have two questions: Anybody knows the limit for downloading images per sec/min? Can I ask Airtable to increase such a limit for me anyhow?
Hi everyone, I want to use metadata API to get details of all the bases used in my project. In the documentation it says,“Enterprise Airtable accounts do not require a separate Metadata API client secret.”. But I am still unable to get the response when I hit the following API with my auth token- https://api.airtable.com/v0/meta/bases Reponse- {“error”:{“type”:“NOT_FOUND”}} Kindly help and do let me know if something is missing from my end. Thanks in advance!
Hello, Could someone help me with a script to delete data from a table passing 1 field as a parameter? For example, I want to delete all records that were recorded yesterday, so I would pass yesterday’s date to the parameter and all data would be deleted. Thanks
I have a problem I can’t seem to solve with Airtable and Vue2 CLI and wondered if anyone could help? I have set up a base and am using a Vue for loop to iterate through a list of objects. Although my loop works, and renders in the browser. However, the order of the objects are completely random. I have tried a different methods to try and get them in the same order as in the base but nothing seems to work. My code is as follows: In my Vue Component; <div class="timeline-wrapper" v-for="record in records" v-bind:key="record.Title"> <h2>{{ record['fields']['Title'] }}</h2> </div> Then in the script of the component I have; import axios from 'axios'; axios({ url: 'https://api.airtable.com/v0/app123456789/', headers: { 'Authorization': 'Bearer key123456789' } }).then((res) => { res.data.records }); export default { props: [ 'columns' ], data() { return { apiUrl: 'https://api.airtable.com/v0/',
My app uses data from several tables via useRecords, so normally any table data changes (from other Airtable instances/users or via the in-app “expandRecord” buttons are triggering a UI refresh, reflecting those changes within a few seconds. However, reproducibly, whenever I start an external “mailto:” handler, either by using a Material UI Link component or directly via a component’s onClick, the app stops updating it’s UI when data is changed outside of it. Any record changes sent from within the app still propagate as intended, but useRecords is no longer triggered when records are changed from outside the app (in another Airtable window or via “expandRecord”). Only a manual “Reload app” seems to get things working again. <Link href="mailto:name@example.com?subject=Mail" className={classes.email} > <MailOutlineIcon size="small" className={classes.taskicon} /> </Link> ... onClick={() => {window.location.href = "mailto:name@example.com?subject=Mail"; }} As
I’m trying to update a base every 24 hours hitting a public API using remoteFetchAsync(). When I run the automation code below, I get this error: ERROR ReferenceError: remoteFetchAsync is not defined at on line 24 at main on line 9 The automation: //output.markdown ("# Updating BTC price"); let table = base.getTable ("Fetch"), records = await table.selectRecordsAsync (); //Check difficulty await Promise.all ( records.records.map (async record => { let stock = record.getCellValue ("Ticker"); if (! stock) { //output.text ("Can't update the price without Ticker"); return; } //output.text (`Updating Mining Difficulty of ${stock}...`); // make request to BTC.com var response = await remoteFetchAsync ( `https://chain.api.btc.com/v3/block/latest` ).then (r => r.json ()); // Parse by hand var data= response.data; var diff= data.difficulty;
I have a table of Items and a table called Used, that has just a date time field and a link to Items. In a grid view of Items, when I click a checkbox it should create a Used record for that Item, with date set to now. I also need a way of clearing the checkboxes for all Items, leaving the Used records as they were. I guess I need 2 scripts? What would they look like? TIA.
Hey everyone, I’ve found this script online (raw version below; https://medium.com/@greg.business.automated/regaining-control-of-your-airtable-gantt-charts-with-this-simple-app-548a2eb40ebb) Basically it helps update Gantt chart columns (start & end date, duration) given a starting task. However its centered around using successor tasks, which for me is a bit impractial as I’m working with a ‘blocked by’ or ‘predecessor’ scheme. I was wondering what I needed to change in the code for this to allow using predecessor tasks. I’ve been trying to play around with it for the last hour but no luck… Any help highly appreciated!! //Copyright © 2020 by Business Automated //Update dates of tasks in Gantt chart in Airtable. To be used together with the Airtable Gantt and Scripting block. // Select the To Do table and records let table = base.getTable("Table 1"); // <== change here the Table name let toDoRecords = await table.selectRecordsAsync(); let nameOfStartDate = "Start Date"; // &
Hi folks I have two tables: One is called “Products” the other is called “Product Components”. As you can imagine there is a (1:N) link between them, so a Product can have multiple Components. A Component has a single Product. Here is what I am trying to do: I need to fetch all Components for a Product. I have a RecordQueryResults called “allComponents”. product.id contains the Product I’m searching for. Here is my code: let components = allComponents.records.filter(record => { (record.getCellValue(“Product”).map(x => x.id).includes(product.id)) }); After this, if I check components.length I will get zero. It is an empty array. I tried debugging using console.log inside my filter callback: let components = allComponents.records.filter(record => { console.log(record.getCellValue(“Product”).map(x => x.id).includes(product.id)); (record.getCellValue(“Product”).map(x => x.id).includes(product.id)) }); The results are: whenever a Product matches product.id I get TRUE; when it
I’d like to be able to create and modify Views via the Blocks API. I know this isn’t currently possible but is it on the roadmap? Somewhat related - is there a publicly viewable roadmap for the various developer products?
I have a field named Echeance that has date of the deadline for each project I have a field named Statut which referres to the project status (to do, done etc…) I want if the current date > Echeance and the status is “A faire” then update the cell to “En retard”, which means late. let action = base.getTable('Action'); let tache = await action.selectRecordsAsync(); let aujourdhui = new Date(); // Date of today for (let ligne of tache.records){ let statut = ligne.getCellValue("Statut"); let echeance = ligne.getCellValue("Echéance"); let dateEcheance = new Date(echeance); if (dateEcheance < aujourdhui && statut["name"] == "A faire"){ await action.updateRecordAsync(ligne, { 'Statut': "En retard", // Here is the problem }); } }```
I am trying to figure out how to translate the in-airtable-ui filters into a filterByFormula method in the request via fetch. I can’t seem to find any docs and some related questions kind of seem like people are figuring these out somehow so I feel like I’m missing something. For my exact example, I’m trying to replicate "where fieldName contains string" in the Airtable UI. I’ve seen some conflicting opinions between using FIND and SEARCH, but neither have worked for me yet. I’m hoping to find something that outlines those available options, similar to how there examples for CURL (and an unofficial CodePen for generating them)
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.