Need development and API help? Ask your questions here!
Recently active
The RecordQueryResultOpts object supports a property named fields which is an array of fields that should be retrieved. If any of the array’s elements are falsey values, they are silently ignored. While this behavior is explicitly documented, I’m not sure it’s desirable. I recently refactored a block to allow all fields to be configured by the end user. This involved generalizing a call to selectRecords: -const queryResult = consumersTable.selectRecords({fields: ['Chapter']}); +const queryResult = consumersTable.selectRecords({ + fields: [consumerFields.region] +}); Code like this is prone to error because the value of the fields elements is abstracted away. Because the API silently tolerates mistakes (e.g. a typo like consumerFields.ragion), the effect isn’t perceptable until some subsequent area of the application logic. It’s not clear when block authors would benefit from the ability to specify values like undefined, so it may be better for the API to produce a synchronous error f
I am extracting a database of children’s books via Airtable API. This is my code so far(hiding my API KEY). It renders every book, but in a random order. I want to sort them by year. I am trying to follow the documentation from Airtable, which demonstrates the code to sort by multiple fields. I don’t really know where to place this code in my original code, and how to adapt it. Thanks for your help! import Hero from '../components/Hero'; class News extends Component { constructor(props) { super(props); this.state = { books: [], }; } componentDidMount() { fetch('https://api.airtable.com/v0/appYI3FvXw9Isfvj7/Favorites?api_key=API_KEY') .then((resp) => resp.json()) .then(data => { this.setState({ books: data.records }); }).catch(err => { // Error :( }); } render() { return ( <><Hero title="Children's Books"/> <div className="container mt-5"> <div className="row">
Dates are not coming in order when I’m loading on my website. - Here’s my code. Please help! I’ve been trying to figure out the sort for hours.
How do I loop through an array that is a set of (Product) RECORD_IDs; creating a record in the ‘Order Items’ table forEach Product, and also linking to the related order? For example, Brutus the Buckeye has the ‘CertainTeed - Highland Slate’ product package applied to his Order. I am having trouble wrapping my head around creating records in the ‘Order Items’ table. This was somewhat inspired from the record template example. This would allow for very common/repetitive list of pre-determined “packages” to be automatically applied as ‘Order Items’ for ‘Orders’. // pick order let order_table = base.getTable("Orders"); let order = await input.recordAsync('Pick an order', order_table) if (order) { output.text(`You picked '${order.getCellValueAsString("Order Name")}'`) } // pick a package(template)to apply to an order let product_package_table = base.getTable("Product Packages") let packagE = await input.recordAsync('Pick a product package', product_package_table) if (packagE) {
I am getting a 422 error code when I try to update a record via PATCH method. Specifically, the Airtable > Update a record event performs the folloiwng HTTP request: curl -X PATCH ‘https://api.airtable.com/v0/APPXXXXXX/Clients/RECXXXXXX’ -H ‘user-agent: Integromat/production’ -H ‘authorization: ***’ -H ‘content-type: application/json’ -d ‘{“fields”:{“Status”:“Lead - New”,“Initial Call Date”:“2020-04-16”,“Post Call Followup”:“None”,“Opportunity Followup”:“None”,“Post Project Followup”:“None”},“typecast”:false}’ for which the module received the following response: Status code: 422 Headers: { “access-control-allow-headers”: “authorization,content-length,content-type,user-agent,x-airtable-application-id,x-airtable-user-agent,x-api-version,x-requested-with”, “access-control-allow-methods”: “DELETE,GET,OPTIONS,PATCH,POST,PUT”, “access-control-allow-origin”: “*”, “content-type”: “application/json; charset=utf-8”, “date”: “Thu, 23 Apr 2020 08:24:37 GMT”, “etag”: “W/“52-ooYmp4xonjkntQ21csI0
Is there a way to filterByFormula with an “IN” type of function. I.e. only return rows where the state field value is in the list [“OR”, “CA”, “FL”] ?
Hi. Is there any way, programmatically or by some setting (either on block or on the dashboard) to change the height of the block within the dashboard? No matter how many blocks are displayed in the dashboard, each of them seams to be 304px tall (including its heading). So even if there’s just one block, there’s a lot of unused whitespace while at the same time the block would be able to display more data. Our custom block displays a lot of content within an iframe, it expands the iframe to occupy as much space as available. But since the height of the block is fixed, it’s rather limited (read “very small”). I know the user can switch the block to the fullscreen, but that doesn’t help as that covers the data in the table, so when the user wants the block to react to cursor change (which is the coolest think and the only reason to use the block in our case), they need to exit the fullscreen, select another record in the table and then either scroll within the block or enter the full scr
I am not new to coding, but I am brand new to the scripting block, and I did a few searches and saw many unanswered topics, and several that didn’t quite fit in to my specific scope. I want to schedule out stories that run in newsletters, and be able to create all the records with user input. Say the following statement is made: “I want 4 stories to run in June, one every Friday, in ABC Newsletter.” Or maybe even: “I want a story to run every Tuesday in GHI Newsletter for the rest of the year.” Or MAYBE even: “I want a story to run every Monday AND Wednesday (2 per week) in the month of August.” I’m not looking to enter the title for each story, just a template title I can enter that is applied to all the records. But where I see the REAL magic is being able to accept user input of the days of the week and the month (or months) (maybe with checkboxes?), and somehow resolving the dates and the number of records to create based on what is checked. For example, if I want Fridays in May 20
Has anyone retrieved data from multiple tables via the api? I can retrieve one set from one table no problem and I know how to to do this in SQL for muliple inner or outer joins but I have a little bit of a block doing this in node.js using the api. Thank you
Hey all is Airtable able to do what JotForm does? Not wanting another solution if I can make it work with Airtable? jotform.com Online Form Builder & Form Creator | JotForm Dropbox File Request: How can someone upload to my Dropbox? I basically just need to have a form my website that allows them to input info and upload the files to dropbox just like jotform says it can do.
how to return the values of a related table, not the key, I try to do this from the javascrip api, what i have is this: const response = await airtablePlanes.list(); and he answers me: [ { “id”:“recJhPPsonGK6WQiO”, “fields”:{ “valor_mensual”:4569, “Name”:“PLAN_4”, “planesToCoberturas”:[ “recGBXvrvXt6KhatT”, “reckjMfRzp6jnHEED”, “recCFBaAfBirzw6V3”, “recg1TjYd6ekRHXqJ”, “recM04lVdWj2CDIeI” ], “descripcion”:"Plan 4 ", “valor_anual”:54825 }, “createdTime”:“2020-04-08T22:25:48.000Z” }, { “id”:“recZQkZ6hI62FqvJ0”, “fields”:{ “valor_mensual”:1286, “Name”:“PLAN_1”, “planesToCoberturas”:[ “reczIR8pPZBAJdSsM”, “recH0CU0TqA9cfiFg”, “receQ9xxWZqrtd2V9”, “recG7E3gux8diAm2D”, “recSsWKkZTCda0kab” ], “descripcion”:“Plan 1”, “valor_anual”:15431, “registros”:[ “recovGEbYXVD3ISb3” ] }, “createdTime”:“2020-04-08T22:24:27.000Z” }, { “id”:“recpDt0xL5yDPcrec”, “fields”:{ “valor_mensual”:2380, “Name”:“PLAN_2”, “planesToCoberturas”:[ “rec9zIsScaSyFwTc0”, “recRFqypir5CyMG9z”, “recNIguFd32J9H5ma”, “recDNT4YUm
Hi, How can we use an Oracle SOAP Service to populate data with an attachment to a table type base created in AIRTABLE? I see you have API examples to create a record in the table by passing the data elements but is there a way we can call an external webservice and populate data? Any help much appreciated! Thanks, SJ
Dear Airtable scripting community, is it possible to share commonly used functions between different blocks of the same database? Currently I use different script blocks for different purposes and would like to avoid duplicating code between them. Is there a way to achieve that? Thanks, Stefan
Hi, I would love to be able to use Cursor model to move the currently selected cell. My use case is to help users find linked records. So here, when the user click on a Record Card, instead of expanding the record, they will be redirected to it. I already send the user to the correct table and update the Block to show the detail of the clicked record, but it will be helpful to select the right cell in the table view. Thanks,
I found a somewhat similar thread in the Support forum (Reordering Link to Another Table column items), however I think this is substantively different. If I were to ask a user to manually order linked records by some criteria, they would intuitively place the “first” records at the top (or left) because that’s visually “first”. However, when fetching results via a formula or via the API the first record returned in the array is the “bottom” or “right” most record—what I think is the “last” record. I understand that the newest record entered “pushes” the other records down/over. I don’t really have an issue with that. It’s just that I can’t think of any reason why the formula/API would show the last record first.
hi, i have this php code. i want to filter the fields to be retrieved to only 2 fields as ‘Registration No.1’ and ‘Registration No.2’. However i cannot get it to work. Here is my array: $params = array( “filterByFormula” => “AND({Email Address}=‘xristos@skyworx.com.cy’)”, “fields” => [{Registration No.1}, {Registration No.2}], “view” => “Registration Application”, ); Can u heklp me out?
This is my code and I can’t populate the field ‘Activities’ which is linked to another table, the error is in line 24
good day! I am looking for a best practice in Airtable for preferrable a Calculation that will write out the long form of an amount, such as is written on a check up to $1,000,000,000.00. I may also be looking to hire a developer to write such a statement. I had done it previously in Filemaker but I’m overloaded with conversion to Airtable and not sure how to handle effectively. Thank you in advance, Ray
Hello I’m trying to write a script that would copy all records from one tab to another. Source tab is called “Activity” and the destination is called "Contacts I think I’m almost there, but confounded on a few things. The script cycles through each record in both tables to: Make sure the emails contact email matches It hasn’t already copied before, dropdown in sync column set to “added to contact” Later will add the values to copy from activity to contact I’m seem to be almost there, but here’s somethings are confusing me it seems to be looping through the activities multiple times even though activity only has one loop, why? It CRASHES when I try to write the Contact Record column in the Activity table. Says “Something went wrong. Reload the block” The update contact part does not work, nothing gets written to the contact table. // Test let contactsTbl = base.getTable(“Contacts”); let activityTbl = base.getTable(“Activity”); let activities = await activityTbl.selectRecordsAsy
I have a formula that calculate’s a person’s age. The problem that I’m having is that when information is entered for ‘Died’, nothing is entered for 'Age of Death’.![Actors|690x225] What can I do to correct this?
Hello there! I was trying to create an filter that acts like this SQL: SELECT * FROM table t WHERE t.Status = “Pending” AND t.Name == “Robert” AND … (and so on…). How can I translate that to Airtable Filter By Formula in the API? I just want to return the records that match those conditions. Using airtable.js to do it.
I’m using the API to update an Airtable table on a daily basis. Everyday I’d get around 100 records to be updates or created on the table. What’s the best way to tell Airtable to either update the record if a specific field matches a record which already exists otherwise create a new one? Do I need to perform a search for each one of the records manually or is there a better way to do that? Thanks!
Hi community. I’m very new to JS so apologies if this seems basic :pray: . I’m using Twilio Functions (node.js) to load to AirTable all incoming texts. I’m utilizing 2 tables - “Receive Text” with columns Text date, Text Body and UID. “Users” with columns UID and Phone Number (and a bunch of others). When a text comes in, I’m trying to use FilterByFormula with the phone number to retrieve the user’s UID from the “Users” table. Here’s the code I’m running - var filter = "({Phone Number} = '" + event.From + "')"; base('Users').select({ filterByFormula: filter }).eachPage(function page(records, fetchNextPage) { records.forEach(function(record) { console.log('Retrieved ', record.get('UID')); alert('Retrieved ', record.get('UID')); }); fetchNextPage(); }, function done(error) { console.log(error); }); let message = { "UID" : record.get('UID'), "Phone Number" : format_phone, "Inbound Text Date" : Date.now(), "Inbound Text Content" : ev
Hi all, I was wondering if there was a way to link records with the Airtable API?
I wish Parabola had an Airtable export feature, but in the meantime, I’m struggling with the code to allow me to create records in Airtable with multiple associated linked records. I got it to work when there is only a single linked record in a field, but I keep receiving a 422 error code saying “invalid record id” whenever there are multiple linked records. The record ids going into {id (1) (concat)} below are a comma separated string (i.e. recXXXXYYYZZZ, recAAAABBBBCCCC). The code I’m using is below. Thanks for any help that you can provide. { "fields": { "Client": ["{id}"], "Timesheet Items": ["{id (1) (concat)}"] } }
Already have an account? Login
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.