Need development and API help? Ask your questions here!
Recently active
Hey everyone! I’m trying to create a script that will read whatever content is placed into the first column “Product Title” and create a url handle out of it. I’m just looking for it to copy whatever record is under “Product Title” to “Handle” and replace all instances of spaces with “-” instead. Thanks so much!
I am looking to run multiple search queries/scripts in three fields where users will enter a long format answer explaining project needs. These are populating in a request table. I have second Airtable that lists out my talent at my agency and have created a ‘Keywords’ column that lists out all the different expertise fields and past industries. My goal is to search through the long format answers client input and connect the keywords to the best match talent in my pool. Any thoughts or stimuli from past projects? Below is what I have tried so far, but do not know if there is a simpler way since it is two air tables and not calling another database outside Airtable let table = base.getTable('Project_Needs'); let resultsField = table.getField('Talent v2'); let record = await input.recordAsync('Record', table); let searchQuery = record.getCellValueAsString("TalentTable_KeywordsField") if (searchQuery) { table.updateRecordAsync(record, {[resultsField.id]: 'Updating...'}); output
I was looking into the Airtable API, and I looked into the section “list records”, I can see the sample code in Javascript, and some of the fields I have looked into, it only works on the ‘text’ or string field type. eachPage(function page(records, fetchNextPage) { records.forEach(function(record) { console.log('Retrieved', record.get('Name')); }); Then I tried adding the “profile photo” field, but knowing the field is actually a array type because there are separate URLS for different image sizes in a array. Simply what I did is this eachPage(function page(records, fetchNextPage) { records.forEach(function(record) { console.log('Retrieved', record.get('Profile Photo')); }); I tested in a playcode.io playground and came out as this: Retrieved (1) [{...}] Retrieved (1) [{...}] Retrieved (1) [{...}] Is there a way to get a item in a array field in this? I just want to get the attachment/image url.
Using gatsby-source-airtable. Was working fine until today (have made no code changes that would affect afaik): FetchError: request to https://api.airtable.com/v0/appXXXXXXXXXXXXXX/Products%20-%20T4?view= failed, reason: connect ETIMEDOUT 54.210.4.251:443 Tested via cURL and that seems to be working fine: https://api.airtable.com/v0/appXXXXXXXXXXXXXX/Products%20-%20T4?view=&api_key=keyXXXXXXXXXXXXXX Is this an intermittent server issue, or should I perhaps be looking within my code to debug? gatsby-source-airtable@2.2.0 concurrency: 5
Not a question, just thought I’d share in case any rookie developers like me are struggling with laying out a custom app. I’m having great success making various layouts for my components by utilising grid template areas via Styled Components - it’s incredibly intuitive. Here’s an example snippet and the resulting layout. Would love to hear anymore layout tips! const Section = styled.div` border: solid black 1px; display: flex; align-items: center; padding: 5px; ` const HeadSection = styled(Section)` grid-area: hd; ` const SidebarSection = styled(Section)` grid-area: sd; ` const LineItemsSection = styled(Section)` grid-area: li; ` const DeliverySection = styled(Section)` grid-area: dl; ` const TermsSection = styled(Section)` grid-area: tm; ` const TotalsSection = styled(Section)` grid-area: to; ` const FooterSection = styled(Section)` grid-area: ft; ` const GridContainer = styled.div` display: grid; grid-template-columns: repeat(9
Hi all, I am triggering a script upon row creation. I want to be able to respond to form submissions and manually entering rows as we migrate to this new table. For some reason the available “Field Values” are different when I test the “Trigger” and “Script” directly in the Automation screen: but when the script runs live against a form submission one field is missing: This is how the automation is failing, but you can see in the first screenshot that that field is available when running the tests: Is there a nuance I need to be cautious of when creating/automating form row creations? Or should I be triggering my automation on both form and manual table row creations? Many thanks for any advice :pray:
In 4 weeks, we’ll be rolling out a small change to the URL format returned from Table, View, and Record models via the .url property. Specifically, these URLs will now also include the base ID in their return value. This change affects both Scripting and Custom apps, and coincides with the recent change to include base IDs in Airtable URLs throughout the rest of product. This may be a breaking change if your script or app makes hard assumptions about the format of this url property (e.g. by deconstructing the returned URL into its component parts with substring() or similar). No action should be needed if your script or app only uses the URL for navigational purposes. Browser navigation will continue to work for the old-style Airtable URLs via redirects, although these redirects may not be supported indefinitely in the future. If your script or app constructs Airtable URLs from scratch, we recommend updating the construction logic to also include the base ID. Summary of changes Scrip
Hi All, I have a Tasks table, and an Appointments table, and I often find myself needing to manually link multiple tasks to a a single appointment. Say we are scheduled to meet with customer XYZ next Tuesday, and I have 30 tasks for them, but I’ll only be able to get to 5 of them next Tuesday. So I want to link those 5 tasks to the appointment. Is there a way to select those 5 tasks and link them all to one appointment? So far I have experimented with using a checkbox column in the Tasks table, something like “Ready to Schedule”, and that works okay, but it creates multiple records in the Appointments table, with the automation running the script after each row is checked. Is there a way to have a script run on the selected records (the checkbox on the far left of each row, not an added checkbox column)? Or am I thinking about this the wrong way? Is there a different approach you would take with this use case? In general I find myself wanting to select several rows and do something wit
Hello, I already posted in another part of the community, I’m wondering if this section would have been a better place? The core issue is that a date formatted formula column causes an error when creating new records with the error as below. ERROR j: Can't create records: invalid cell value for field 'Date'. Cell value has invalid format: <root>.0 must be a string, <root>.1 must be a string, <root>.2 must be an object at main on line 131 Thanks for your ideas!
Hello! I am brand new to Airtable scripting and trying to get a very simple script to work with no luck. What I am trying to accomplish is to have a use click a button then run a script to update 2 fields on that record. I have pieced this together and it doesn’t show any specific error but also doesn’t change the field (I am starting with only one first to see if I can get this working). Any ideas on what is going wrong? // Change these to match your base. let table = base.getTable('Master_Table'); let field = table.getField('Step'); // When run from a button field, the script skips the prompt // and automatically uses the button's record. let record = await input.recordAsync('Choose a record', table); let value = field.updateOptionsAsync.toString("QC Ready");
I have been successfully using this script for almost a year now and it stopped working last week. Did something on the backend change? Here is the error message I am getting: TypeError: record.getCellValue is not a function or its return value is not iterable at main on line 76 Here is line 75 and 76 of my script: if (unique && record.getCellValue(“Lock Content”) == true) { for (let rec of record.getCellValue(fieldToWriteTo)) { “Lock Content” is a checkbox field. Ultimately when it is checked the script doesn’t edit those records and when it is unchecked it is supposed to update, but I am getting the error message. I have never had this problem with this script and I like said earlier we have been using it for almost a year now. Here is my whole script. It’s a bit long and has some old iterations still in there. /* C O N F I G */ /* names: fill to match own table*/ let tableToPullFromName = 'Content Library'; let viewToPullFromName = 'Grid view'; let tableToWriteToName = 'Con
Hi, I have a problem with displaying the data from the API AirTable… it appears correctly on the console screen, but it does not appear in the exact location on the site
Can I have an OAuth2 authorization flow where the redirect_uri points to a custom app URL?
Hi all, Can I use Next.js to run a Custom App? Have any tried it before? Are there any incompatibilities? Thanks
The Airtable REST API allows one to create, update, and delete up to 10 records at a time. I need to know whether or not Airtable will prevent the modification of all record info provided in the request payload if any issues are to arise in the operation, whether that be due to partial bad input on my end or an issue on Airtable’s end. From doing some quick testing it seems that if operations are atomic but I’d love some confirmation from Airtable staff on this. Thank you!
I would like to know how to copy a column “Items” from one table to another table. Both table have the same naming “Items” Table Name: DB_Checklist Daily_Closing_Checklist View Name: DB_Checklist > Closing Field Name: DB_Checklist > Items Daily_Closing_Checklist > Items I want to copy one of the row of data from DB_Checklist/Closing/Items to Daily_Closing_Checklist/AllEntry. Can anyone show me how to code this? let checklist = base.getTable("DB_Checklist"); let checklistView = checklist.getView("Closing"); let dailyClosingChecklist = base.getTable("Daily_Closing_Checklist"); I only know this much, want to learn more on how to make my table more automate.
I have this script I made a month ago. It worked perfectly fine. Just tried it today and it doesn’t work. The fields that I’m updating with updateRecordAsync do not update. They are just blank. let newRecord = await main.createRecordAsync(obj) main.updateRecordAsync(newRecord, { "ID" : newID, "Discipline" : {name: record.getCellValueAsString("Discipline")}, "Experience" : {name: record.getCellValueAsString("Experience")}, "Duration" : {name: record.getCellValueAsString("Duration")}, "Activity Type" : {name: record.getCellValueAsString("Activity Type")}, "Content": newCombinedText }) Like I said, this script did exactly as I wanted to in the past. Did something change with updateRecordAsync?
Hello! I believe I discovered a new issue when working with Airtable’s automated testing feature. Here is my sample component: import React from 'react'; import { useBase, useRecords } from '@airtable/blocks/ui'; const Main = () => { const base = useBase(); // Table and view name will vary depending on your base const view = base.getTableByName('Component Table').getViewByName('Potluck Volunteer Sheet'); const records = useRecords(view); return ( <div> <h1>Testing useRecords</h1> <p>{records.length} records found for {view.name}</p> </div> ); }; export default Main; And here is the example unit test: import React from 'react'; import TestDriver from '@airtable/blocks-testing'; import { render, screen } from '@testing-library/react' import Main from './main'; import { fixtureData } from './fixture'; const testDriver = new TestDriver(fixtureData); describe('main', () => { it('renders correctly', () =>
I need to know how i ask to run script when new record is created and define if name in: var response = await fetch('https://api.agify.io/?name='+name); is equal to Prénom used from table else only change records only for this person. I give you a screen of my table // query for every record in "trombinoscope" let table = base.getTable("test"); let view = table.getView("Donnée brut"); let query = await view.selectRecordsAsync ( { sorts: [ // sort by "Prénom" in ascending order... {field: "Prénom"}, ] } ); let records = query.records; // print ID & "Prénom" from each record: for (let record of query.records) { let name = (record.getCellValueAsString('Prénom')) ; let response = await fetch('https://api.agify.io/?name='+name); /*fetch('https://api.agify.io/?name='+name) ;*/ /*console.log((await response.json()).age);*/ let agifyAge = (( await response.json()).age); let records = query.records; for
Hi, Is there a way to Programmatically(*) Hide / Show Field(s) - Add / Modify FILTER to an existing VIEW ? Same question came into my mind about: COLOR & SORT. Best, oLπ (*) = by SCRIPT Block.
Can I get a second pair of eyes on my script? Expected behavior is that a user can click a button on any record in the “People” table, and it will create a record in the “Payouts” table, linked to People by a lookup field called “Person” I don’t get any error messages when I run this script, but I also don’t get any new records in the “Payouts” table. And I’m the only user on the license, so I don’t think it would be a permissions error. Can you see anything I’m missing? Thanks in advance! const childTable = base.getTable('Payouts'); const parentTable = base.getTable('People'); const parentRecord = await input.recordAsync('Parent record', parentTable); const linkField = 'Person'; const newRecordValue = parentRecord.getCellValue("Account Balance")*(-1); console.log(newRecordValue); childTable.createRecordAsync({'Amount': newRecordValue, linkField: parentRecord});
Is is possible to have a button perform a script to input values into other cells all in the same table?. For example, if a field is set to button and you click the button, then do the following: In the Columns “Sales” and “Orders” place data from Column “Estimates” Thanks
The code works fine without using Airtable SDK. Any ideas on what can be causing this? You can see it working here: vibrant-snow-m8sl6 - CodeSandbox Here’s my code using Airtable’s initializeBlock() : import React, { useState } from 'react'; import { initializeBlock } from '@airtable/blocks/ui'; import { Dropdown, Field, Menu, Item, Select, Label, } from '@zendeskgarden/react-dropdowns'; interface IItem { label: string; value: string; } const items = [ { label: 'Fern', value: 'item-1' }, { label: 'Snake plant', value: 'item-2' }, { label: 'Rubber tree', value: 'item-3' }, ]; const App = () => { const [selectedItem, setSelectedItem] = useState(items[0]); return ( <Dropdown selectedItem={selectedItem} onSelect={setSelectedItem} downshiftProps={{ itemToString: (item: IItem) => item && item.label, }} > <Field>
Hi Airtable Team, Based on above screenshot, is it true Airtable doesn’t support API for chart?
Hey all, I’ve tested a simple script that takes two Rich Text fields and copies them into a third field, and excitingly the Markdown format keeps as I’d hoped. :partying_face: My next step is to now have two tables in a base, a primary table that has field lookups to the secondary table. And then any lookups added to the primary table record - to have their single Rich Text fields (in the Secondary Table) combined into the Primary table Rich Text Field. I’m basically substituting the Airtable RollUp formula due to it lacking support for Rich Text, as although the Rollup works unfortunately it drops all formatting (and I’ve since written a support request to address this). Here’s my work so far, keep in mind I’m still learning JS so this is all new to me. I understand some of the basics, but am struggling to understand the syntax of how to place the Lookup Name values into a For Loop, and then assign each of their Rich Text contents to a variable that I then combine into the Primary T
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.