Need development and API help? Ask your questions here!
Recently active
Is it possible to amend records using API without losing linked fields?
Hi All, I’m very new to airtable and I am trying to write a URL to POST to my airtable and I am trying to figure out what the URL should be. I am trying to post a jpg as an attachment to a cell. I was able to pull data from my airtable with - https://codepen.io/airtable/full/rLKkYB. I am not having success with posting data to the table using the codepen listed. I am using Airtable in Dynamo for Revit. Any guidance could help. Thank you for your time, Mike
I am fairly new to Airtable and was having trouble finding information on the filterByFormula option in the API. I was trying to get rows back based on a DATE field using a date range, so any date that fell between my startDate and endDate. I couldn’t find any specific examples, so I am posting this to hopefully help someone else that tries to do this. Below is some javascript code using airtable.js and this is what I used to be able to get results back within the range: let data = await base(‘Timelogs’).select({ filterByFormula: IF(AND(IS_AFTER({DATE}, '${startDate}'), IS_BEFORE({DATE}, '${endDate}')), 1, 0) }).all() This may have been elementary but I about ripped my hair out trying to get this UBER simple process to work. Edit: There are backticks (quotes would work too of course) around the IF() portion. This editor doesn’t seem to print them. startDate and endDate are variables in the code and I am using template literals to pull the values in.
I couldn’t find this in the documentation or answered on this forum. I was recently brought in to get a handle on our organization’s technology. They use Airtable extensively and have a few zapier automation. Recently a high-level employee was released from the company causing a security audit (by myself). Which accounts (what level) can generate an API key? Is there a way for admin accounts to view and control API access for accounts that are not their own? ie: I want to see all accounts that have generated an API and/or be able to delete and view any automation occurring across all bases in a workspace. Thank you for any assistance. Matthew Moran
Hello, I’m getting the following error: Class { error: ‘UNKNOWN_FIELD_NAME’, message: ‘Unknown field name: “2019-09-16”’, statusCode: 422 } in a select from a view with the following config { "maxRecords": 1, "view": "Employee data", "filterByFormula": "AND({SlackId} = 'UD5UYN55L', {Active})", "fields": [ "Firstname", "Lastname", "ATEmail", "SlackID", "Office", "Type", "Team", "AutoCreateNextWeek" ] } where the field marked as unknown is not present. This is my code: let getActiveEmployee = (slackId, airtableClient) => { var config = { maxRecords: 1, view: "Employee data", filterByFormula: "AND({SlackId} = '" + slackId + "', {Active})", fields: fields } var select = airtableClient('Dispatch').select(config) console.log("config1: " + JSON.stringify(config)) return new Promise((resolve, reject) => { select.firstPage((err, records) => { if (!err) { if (records.length > 0) { console
Not sure where to start after doing the tutorial? We’ve put together a few examples of custom blocks that can help get ideas flowing. The code for these examples are in Github. What have you found helpful in your ideation process? VISUALIZATIONS Simple Chart Summary CUSTOM REPORTING Print Records SELECTIVELY UPDATING RECORDS Update Multiple Records Block EMBEDDED PREVIEWS Youtube Preview To-do List ENRICHING DATA VIA API Wikipedia Enrichment Block
I’m curious if anyone has been able to access a single table’s model via the API. I can’t find anything in the API documentation that allows it, but I assume it’s possible due to the fact that the API documentation itself is being generated based on the tables’ model/columns defined within an Airtable base. What I’m trying to do is create a client-side data sanitiser and validator. I’d like to control the relationship between the client and the app. Ensuring the data is formatted correctly is a time saving measure that I can do before submitting to the Airtable API and helps me to provide a nicer smoother experience for users. It should also hopefully let me store valid data offline (which won’t error later when being submitted) to then submit to the Airtable API later when connectivity is available. Since Airtables can have their model/columns changed easily, fetching the model could also mean automating any migrations or potentially reconcile differences between one version of the AP
Hi, So i would like to print my A4-document from the Page Designer block on my mobile phone (iPhone in this case). Is there any way to access/print/download this document without going to the desktop version and push print? Thank you.
Hi guys, I’d love to see the existing ‘filterByFormula’ feature for ‘List records’ to be implemented for (batch) deletion of a record set. The GET request already has this option which would fit most (if not all?) ‘cleaning up’ scenarios too IMHO. Just replace ‘returned’ with ‘deleted’, issue a DELETE request to the table endpoint and we’re done. :winking_face: filterByFormula A formula used to filter records. Only records which satisfy the formula will be returned. If combined with view, only records in that view which satisfy the formula will be returned. As a side note: I could also use this in UPDATE situations. To set timestamps or other flags for a set of records. Best, Arthur.
I am working with the Airtable API using PHP to retrieve records. I find that I can use curly braces around field names when using filterByFormula. However, I cannot use curly braces around field names when specifying which fields to include or which fields to sort by. This does not appear to be a problem because field names with spaces are retrieved even without the curly braces. However, I still found being unable to include curly braces confusing. Has anyone else noticed this? I didn’t see this covered in the documentation.
Hi, when using the API to read the stored records, what’s a good way for the client to know if there’s been updates to the content? Do we have to make the decision ourselves (ie download the whole data and compare), or is there a way to check “last updated”? Sorry if I missed that somehow.
I was trying to build an app based on Airtable using Appsheet. With one case I got an error in Appsheet, that turned out to be a limit on the Airtable site. It looks like the API does not handle more than 21 columns well. Is this a familiar problem? See below the feedback from Appsheet support, who really took their time to find out what was going on: RESPONS APPSHEET SUPPORT: After quite a lot of testing and investigation, I believe I have finally found the root cause of the problem. Roughly speaking, each time AppSheet reads data from AirTable, AppSheet will send a request that contains a list of parameters to AirTable, and some of these parameters are names of the columns to be read. It appears that currently, AirTable imposes a hard limit of at most 21 parameters. Any request that contains more than 21 parameters will be rejected. Since the table that you were trying to add to your app had more than 21 columns, the number of parameters in the request to read this table exceeded 21,
Hi all, I am new to the Airtable community. I have menu items table it contains 15 records. I want to filter the menu key and restaurant key in menu items table. Because i am getting all restaurants and all menus in menu items table. How to filter the both Restaurants and Menus at a time. I placed this code for filtering the menu items:- [{“key”:“filterByFormula”,“value”:“Find(“Sides”, Menu)&(“The Montauk”, Restaurant)”}]
I’m trying to fetch recently modified rows via the API. Seems to me that this should work, but it doesn’t return any rows… filterByFormula: "LAST_MODIFIED_TIME() > '8/17/2019, 7:36:49 PM'", what am I doing wrong here?
I have a base that is a migration from a MySQL db and a web based (I think JS) app. I did not build the original and the person who did has disappeared. I am not a coder. Successfully migrated the data and created the proper links within the base, but the client really wants something pretty on the front end. The db is a list of photographs with info like size, medium, etc. and pieces sold for how much, how many in the series, etc. They want an interface to interact with the db like they had. Is this doable and how might I go about it or might there be someone who is interested in doing the work? Thanks in advance. Howard Goldstein
When attempting to use the PATCH method in Google Apps Script , I get an error INVALID_REQUEST_UNKNOWN . I’m able to do a POST and GET request. Tested my credentials using CURL and this worked. Tried the “HTTP Override” hack and that did not work. function postToAirtable() { var url = 'https://api.airtable.com/v0/appxs9P0mXsqcXs5R/Outreach'; var data = { 'fields': { 'Task': '<Task Name>', 'Outreacher': '<Person>', 'Month': 'May ', 'Status': 'In Progress', 'Go Live Date': '2016-03-01', 'Copy Card Link': [ 'recONM5ul2oaG6yKi' ], 'Label': 'DET' } }; var headers = {'Authorization':'Bearer ' + '<API KEY>'}; var options = { 'contentType':'application/json', 'method' : 'PATCH', 'headers': headers, // Convert the JavaScript object to a JSON string. 'payload' : JSON.stringify(data), }; //Logger.log(options); Logger.log(UrlFetchApp.fetch(url, options)); };
Hello guys. I thought this would be a good place to get help. Please read here: support.glitch .com/t/airtable-database-issues-javascript-project-hoggystyle/13795/10 Please delete the dot in front of .com
I only have 1 table and I need the most recently added record. I tried this code and even tried maxRecords so loop through each id. base(‘Intention’).select({ filterByFormula: ‘{id} = “id”’ }).eachPage(function page(records, fetchNextPage) { records.forEach(function(record) { console.log(‘Retrieved’, record.get(‘id’)); … Any tips on how I should approach this?
I have a Firebase database that mirrors data from an Airtable view. Functionality is in place that allows an Admin user to trigger an import of the Airtable data over to Firebase. This has been working for a few months without issue. Recently, I have started to see that my Firebase function that pulls the images from Airtable records into Firebase is failing. I was wondering if anything has changed or if anyone knows any reason for this. In a Firebase Function I am importing the image from Airtable with code like: let fromUrl = firebaseRecord.fields['Headshot'][0].url; let filename = firebaseRecord.fields['Headshot'][0].filename; firebaseAdmin.storage().bucket(config.firebase.bucket).upload(fromUrl, {destination: filename}) And I get an error like this in Firebase (URL truncated for privacy): ENOENT: no such file or directory, stat 'https://dl.airtable.com/.attachments/be2454...b0c70d14/d3...f0/600-uVJ...B3.jpeg' If I then try to open that URL in a browser, the image is returned and di
Running into this problem: {"error":{"type":"MODEL_ID_NOT_FOUND","message":"Record not found"}} I am doing a PUT request, so I don’t understand why a record needs to be found :confused: PUT assumes your record already exist, that was the problem. There seems to be no way to insert a or update a record if it already exist (like MySQL insert into ... on duplicate key update) in one API call. The above issue got resolved by switching to POST instead of PUT and now I am getting the following error: {"error":{"type":"INVALID_VALUE_FOR_COLUMN","message":"Field \\"lastUpdated\\" cannot accept the provided value"}} I am passing a timestamp (large integer) for a single line text field. Specifying typecast:true or typecast:false doesn’t do anything. Here is the json data posted: {"typecast":false,"fields":{"symbol":"WPC","sector":"finance","lastUpdated":1565899200000,"lastSalePrice":87.955}} Weirdly enough typecast doesn’t do anything. As you can see above, I was posting an integer and a float
I’m trying to create a record using the curl API, and one of the fields in my record is of type “Multiple Select”. The possible values are integers (formatted as strings since that’s the only option for this field), so it’s supposed to be entered as [“1”,“2”,“3”] etc. However, I am using an integration that only supports mustache formatting, and with mustache, JSON arrays get parsed as [1,2,3] and this is not accepted by the API. I’ve tried setting “typecast”:true and it doesn’t work. Is there another way of accomplishing what I’m trying to do here?
Hi, I am new to Airtable and am trying to build a query that will act like a global search across multiple columns. Our members table has the following columns {‘Full Name’,‘Phone’,‘Email’} that I would like to search. I want to have a single search field on our site to look up members by either their Full Name, Phone, or Email. This is the query that I am using, but it doesn’t work, and I have tried many incantations to no avail… record = await table.select({ filterByFormula: OR(‘Full Name’=searchString, ‘Phone’=searchString, ‘Email’=searchString), fields: [‘Member’, ‘Full Name’, ‘Phone’, ‘Email’, ‘Status’, ‘Member Photo’] }).firstPage().then((records) => { rec = records[0][“fields”]; return rec; }).catch((err)=>{ console.error(err) }); The above code works great if I use a simple filterByFormula such as: filterByFormula: 'Member=' + member_id Thanks in advance for any assistance!! Mike
It appears that the record objects returned from the API are dropping any fields that do not have a value. Except in the case of linked table fields, then the field is there but the value is an empty array. This behavior is unexpected for me and I have a few questions… Is the behavior I described in fact the existing/intended behavior? Or am I missing something? If so, then this is unexpected for me because: Empty values are being represented inconsistently based on field type. Why represent a null text field as a field that doesn’t exist, and a null linked records field as an empty collection? I would expect to see fields that I know to be in my table to be faithfully represented in the API, even when those fields have null values. I have to inspect every single record to see what fields it has before I can reliably map it onto a model object. This is less than ideal for several (obvious?) reasons. I noticed this behavior when using the Ruby client, but curl produ
Is there a way to access or recreate the activity feed you get with every entry using the airtable API?
I would like to report a bug. Airtable javascript library has bad error handling when used with promises: The following code demonstrates a wrong function call to table.create(). This function should be called with two parameters, and here I call it with one. Therefore, there should be some reasonable error message or the .catch section should be executed, but instead the program just hangs with the promise left unresolved forever. At a later time, it would log an unclear warning UnhandledPromiseRejectionWarning. But the promise is still left unresolved. Here is the sample code: var Airtable = require('airtable'); var base = new Airtable({apiKey: 'YOUR_API_KEY'}).base('YOUR_BASE_ID'); base('tablename').update({ "something": "wrong" }) .then( (record) => console.log("never gets here.", record)) .catch( (err) => console.error("never gets here neither", err) ); The full error message that appears in the log is: (node:7969) UnhandledPromiseRejectionWarning: [object Object] (n
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.