Need development and API help? Ask your questions here!
Recently active
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)
I have a table with Large set of rows, I have an Array of Record IDs which I do not want to display in the result of records, how to do that? I am using airtable API for JavaScript, I have tried using filterByFormula but unable to understand what syntax to write for this exact functionality Sign in - Airtable in this filterByFormula: "NOT({name} = '')" instead of '' I want to able to pass an array if possible, or any alternate solution for the same
Hello I would like to create a field where when data is imported into AirTable, that it would input the current month as written into a specific cell. like “7/1/2021”, for any entries entered in that month, I want this one cell to enter 7/1/2021, and not update any previously entered rows.
Hey guys thank in advance, I’m trying to fetch a single record base on email Address column. I’m using Express and Axios from the front end to parse the req.body request and pass it in to the select method with the filterByFormula option, but it seems that every time I use template literals the response brings back all values in the email column. any idea why is that. I’v tried several variation, but with no luck. const record = await sheet.select({ filterByFormula: `"{Email} =${email}"`}).firstPage() plus I was wondering if I can fetch a record with the find method, but based on a column and the id is that possible? cheers to all
Hi guys, I’m creating some bases on Airtable which I want to embed into my wordpress website with different filters, a bit TripAdvisor-esque. It will actually form the main part of my website (lots of tutorials are for embedding forms etc but I want this to be a full online database) Which integrations would you recommend? Thanks Sana
Hello, I have a table called “Prospects” in which there’s a single select field called “Status”. All the values in this table are filled from a connected form, but I am trying to insert a default value for “Status”. Regular “default value” functionality doesn’t work on single select, and even when I change to text/number - when the record is inserted via a form - the default values don’t really apply. I have trying working around it by rewriting the “find and replace” script - find all null values in “Status” field and change to “1”. let table = base.getTable("Prospects"); let field = table.getField("Status"); // Load all of the records in the table let result = await table.selectRecordsAsync(); // Find every record we need to update let replacements = []; for (let record of result.records) { let originalValue = record.getCellValue(field); console.log(originalValue) let newValue = 1 //originalValue.replace(findText, replaceText); if (originalValue !== newValue) {
I have a database that tracks inventory. There is a linked “Historical location” field that I would like to update every time the item moves to a new room ( i have a separate rooms table). I’ve read through forum posts and tried a few things. I gather that I need to map the existing linked field array and then add to it. Or somehow determine how many items are already linked and then add the new one. Any help is appreciated. Example: Inventory #1234 Historical Location: room1, room5 ----Item moves to room15---- ----update historical inventory with that new room ---- Inventory #1234: Historical location: room1, room5, room15
Hi all! I’m developing a script that triggers when a new row is added to a table (it makes HTTP call to retrieve more data, and add to the missing columns). I’m currently using “When record is created” as a trigger, and it works well in cases where the entire row is added to the table at the same time through other automations, or copy-paste. My problem is with written inputs. So if a user writes the data manually, the script triggers too soon, before all the columns are filled in, thus with only partial inputs to my HTTP call. What’s the best way to overcome this? Intuitive I thought the trigger would work so that when a user is adding the row, it fires only when the focus goes away from the added row. But obviously not. :slightly_smiling_face: Thanks for the help! Cheers, tommi.
I’m looking for a way to import subtitles to Airtable. Fir instance Airtable has Youtube video links in one of the columns. The solution (e.g. script) would grab that link, go to Youtbe and fetch the transcript. Anybody has attempted this? Here is somebody who shared a script apparently. gist.github.com https://gist.github.com/Phoenix-Effect/fbc8e54af71424d7ce4e86d54182f8b1 main.py import pafy import os import glob import re from airtable import Airtable from airtable.auth import AirtableAuth import requests from pathlib import Path from webvtt import WebVTT This file has been truncated. show original
My very simple script (in an automation) to trigger a webhook containing record ID is failing intermittently. I do not know the cause. The error is “Script exceeded execution time limit of 30 seconds”. Such a simple script shouldn’t ideally throw an error. Can anyone suggest a way forward? V
Is there any way I can query all of the available options in a Multiple Select field through the GraphQL API?? It’s not that I want to get a specific table value which is a multiple select. What I want is to get all of the possible values. Thanks in advance
Is it possible to modify image EXIF data in Airtable such as date, time, GPS? I found lots of information about how to read EXIF and save it in Airtable but there is no info about how to edit EXIF. Thank you.
I have an Airtable which is a calendar schedule. I would like to use the API to apply this calendar to my website. However, I don’t want it to be “hot.” In other words, I don’t want changes in the table to immediately populate the website, because there might be an error. I’d like to have a staging environment for the API, that only changed when I approve what is in the Airtable, not in real time. What is the best way to do this? Thanks in advance!
My use-case is that I want to send a slack message when a record is created. The reason I am not using the built-in Slack Message automation is that I want to customize the Slack Message using Attachments and Blocks features. I am wondering what is the best practice to get your SLACK_TOKEN from the Script itself. Is there a built-in variable that holds it? Should I use input variable or should I just assign the token to a variable? how safe it is? Thanks in advance!
I have a custom solution that automates adding a linked record and auto-filling some fields, and the app is wired to a button. Every time the button is pressed, the sidebar opens to the app. I imagine this is totally expected behavior, and desirable for most custom app implementations, but is there any way to get the app to run “in the background” without opening the sidebar? I’ve noticed, for instance, that if someone clicks the button from the expanded record view, rather than directly from the grid, the sidebar goes full screen and my user testing shows people are getting confused by this takeover and having trouble finding their way back to their original context. Can we just prevent the sidebar from opening somehow?
I’m having trouble calling an external API (frame.io) from an Airtable scripting app using remoteFetchAsync(). This is what I’ve tried: // Change this name to use a different table let table = base.getTable("🎬 Projects"); // 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}`); const teamId = 'team_id_hidden_for_security'; const resp = await remoteFetchAsync( `https://api.staging.frame.io/v2/teams/${teamId}/projects`, { method: 'POST', headers: { 'Content-Type': 'application/json', Authorization: 'Bearer token_hidden_for_security' }, body: JSON.stringify({ name: record.name,
When we send an update operation to Airtable, it returns all fields from the updated record, is there a way to filter those fields and return only the necessary ones in the same request, without needing to use query the record again? Like when fields is passed through the query parameters?
Some time ago I requested support for BC dates in Airtable date fields (perhaps by denoting them as negative dates). I understand this feature is not a large value proposition for Airtable, and that it probably presents some unique challenges. I lieu of official support for BC dates in the date field, I figured I’d see if I could tinker with the Timeline App to see if I could get it to ingest a modifier that will convert a date to BC. Alas - the Timeline App is not open sourced like several other Apps by Airtable. So at this point, I’d like to reiterate my request for support for BC dates in Airtable date fields, or else request that the Timeline App be open sourced. My goal, if it wasn’t obvious, is to be able to build a massive historical timeline for educational purposes. I think Airtable provides a very neat platform for something like this because of the ability to expand a timeline record and explore any number of custom fields, including photos, videos, PDF’s, relevant data, and
Hello, I am trying to send some lines of text through the JSON body of my POST request using Airtable API. I want to add that information in one of the Long text field inside my table. In case of normal characters it works fine but I observed that whenever my text contains double quotes or new lines, the API call gives error with HTTP status code as 422. I did a bit of research and found that I need to escape those with a backslash for eg. new line as \n and " as \\" so that my request body is json compatible. However as my text could contain any characters that we can type, I am unaware of how many different characters I will need to escape to parse my request body successfully. I am currently thinking of some function that can help me escape my input text. I am vba developer but my knowledge about working with JSON and APIs is limited so any help about what characters need to be escaped and best way to make it possible will be much appreciated. Thanks.
Already have an account? Login
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.