Need development and API help? Ask your questions here!
Recently active
I am very new to Airtable, and am after help with the script block. What I would like to achieve is exactly what has been given as an example here. This is what I have written: let lineItemsTable = base.getTable(‘Order Line Items’); let siteOrdersTable = base.getTable(‘Label Orders’); let productsTable = base.getTable(‘Product Inventory’); let siteRecord = await input.recordAsync(‘Select a Site’, siteOrdersTable); if (siteRecord) { let labelRecord = await input.recordAsync(‘Select a Label’, productsTable); if (labelRecord) { let quantity = parseInt(await input.textAsync(‘Quantity’), 10); let recordId = await lineItemsTable.createRecordAsync({ ‘Job’: [{ id: siteRecord.id }], ‘Item’: [{ id: labelRecord.id }], ‘Qty’: quantity }); let allRecords = await lineItemsTable.selectRecordsAsync(); let record = allRecords.records.find(record => record.id === recordId); output.markdown(Added new Label Item: **${record.getCellValueAsString('Description')}**); let addAnother = await input.buttonsAs
I have a field that is an array of strings. I’d like to filter a table based on this array field and return the row if one of the strings in the array is an exact match on, let’s say, the word “sugar”. It should be exact match only so it should not return rows that include the word “brown sugar” in the array. I run into the latter issue when using Find() and Search() on an ArrayJoin() of the field which seems to search for any occurrence of the string. Is it possible to search an array for an exact match?
I would like to create a workaround for the issue that Linked Records are not available in Automations. I am collecting lots of URL inputs from colleagues via the web clipper. For a number of reasons I want to link the records to another table automatically, using a script. The idea would be to trigger the script using an Automation. In short: I want the title of the Calculated site to be copied into the linked record field Sites I feel like this should be fairly simple but I’m not able to dig into JS :confused:
Hello, I had a quick question about the Airtable API. I wanted to integrate Airtable to post data from users that sign up to the form on my site. I’ve never used Airtable and I wanted to use it with Axios. Has anyone tried using a proxy or any other method to connect to the database. I don’t want to do it through Axios as that would expose my API key. I’m new to back end so any help would be appreciated.
Hi everyone, I have no scripting knowledge and I have the below script from our community SCRIPT let table = base.getTable(“CopyRows”); let query = await table.selectRecordsAsync(); let recordsArray = ; for (let record of query.records) { let quantity = record.getCellValue(“Quantity”); if (quantity > 1) { for (let i = 0; i < quantity-1; i++) { recordsArray.push({ fields: { “Name”: record.getCellValue(“Name”), “Status”: record.getCellValue(“Status”), “Quantity2”: record.getCellValue(“Quantity2”), “Quantity”: quantity } }) } } let quantity2 = record.getCellValue(“Quantity2”); if (quantity2 > 1) { for (let i = 0; i < quantity2-1; i++) { recordsArray.push({ fields: { “Name”: record.getCellValue(“Name”), “Status”: record.getCellValue(“Status”), “Quantity”: record.getCellValue(“Quantity”), “Quantity2”: 1 } }) } } } console.log(recordsArray); let YOUR_TABLE = base.getTable(“YOUR_TABLE”); let newRecords = await YOUR_TABLE.createRecordsAsync(recordsArray); The script working fine
I have a script that I am testing on a CRM system we use and I’ve run into an issue. The basic automation workflow looks like this: A new record is added to a form which shows up in a view called “unprocessed.” This view is filtered on a linked record field, and any new record entered via a form will be missing the linked field data and so will automatically show up in this view. As soon as the record drops into the view, the automation script fires The trigger is “When a record enters into a view” The action is to run a script. The script itself loops through a second table to find matching records - and updates the appropriate linked records field for any matching records it finds. As a result, the record no longer appears in the unprocessed view since it now has a value in the linked record field. The script runs well when there is one record in the view, but when multiple records enter the view at near the same time I believe it causes conflicts as the script runs for each record.
I created a script to be used into an automation when a new record is created. 90% of the times it runs well (using less than 500 miliseconds), no problem… but 10% it exceeds 1000 miliseconds of CPU time (I know about the restriction). Is there a way to get a higher limit (even paying more)? Also I’m looking to try it more faster, which parts are “heavy time consumers” of my code for an Airtable script? let users = base.getTable('CoreVette'); let reps = base.getTable('Reps'); let refs = base.getTable('References'); let inputConfig = input.config(); let newRecordId = inputConfig["recordId"]; let repsResult = await reps.selectRecordsAsync(); let repsStorage = {}; for (let recordRep of repsResult.records) { repsStorage[recordRep.getCellValue('Email')] = recordRep.getCellValue('Manufacturer'); } let refsResult = await refs.selectRecordsAsync(); let refsStorage = {}, ptAux = '', refAux = ''; for (let recordRef of refsResult.records) { ptAux = recordRef.getCellValue('PT V
Ok first this is the set up: 1 table base 7 separate table tabs with individual table names Using react and the npm airtable package I am making a call in the api to retrieve 1 record by its ID. const base = new Airtable({ apiKey: Key }).base(id); const table = base(‘table name’); const recordId = 'recordidfromairtable'; table.find(recordId, function(err, record) { if (err) { console.error(err); return; } console.log('Retrieved', record.id); }); This works and returns the record. However it seems if you change the table name you are searching on as long as it is a valid table name it still returns the record even if it sits in a different table. Now whilst this is a functionality we are looking for i.e. a search on all tables in a base. This doesn’t feel like this should be working. i.e. if the table name doesn’t contain the recordId then it should fail but it still returns the record regardless of the table you are searching? After reading various documentation searching al
I’m trying to use the --remote feature of the CLI to install my Custom Block into another base, but it doesn’t seem to be working. I’m not sure if I’m doing something incorrectly. I went through the process of “Install a block”, “Build a custom block”, and saved the appID/blkID, leaving an empty and uninitialized block Then I ran the CLI commands, with apparently successful results: But my block remains uninitialized. I’ve tried refreshing multiple times, and I’ve tried running the CLI commands again, and it doesn’t look like it’s done anything. I tried running just $ block release as well (not specifying a --remote), and my default installation of the block was updated (tooltip indicates “last updated” with today’s date). So it appears it is only the remote option that is not working as I expected. @Kasra @Michelle_Valentine
Is there a way to create a Dropdown Menu inside a custom Block to filter by own configured Airtable Views? Airtable Airtable | Everyone's app platform Airtable is a low-code platform for building collaborative apps. Customize your workflow, collaborate, and achieve ambitious outcomes. Get started for free. I’am not quite sure if this is what would work for my case. Is there any Example Demo/Code for that? Thanks!
I’m having some trouble using a Script Setting input field when building a new record using CreateRecordAsync. Any help would be appreciated! Thanks! I keep getting errors like this Field ‘orderEvents’ does not exist in table ‘Inventory & Order Events’ at main on line 318 Here is my setup const config = input.config({ title: 'Replenish Script', description: 'This utility/script acts like a form for choose information about the coming replenishment', items: [ input.config.table('eventsTable', { label: 'Inventory & Order Events', description: 'Choose Inventory & Order Events Table' }), input.config.table('locationsTable', { label: 'Locations Table', description: 'Choose the Contacts and Vendors table' }), input.config.table('measurementsTable', { label: 'Measurments Table', description: 'Choose the measurements table' }), input.config.table('productsTable', { label: 'Products Table',
I know about the restriction related with max CPU time (“Scripts can use a maximum of 1 second of CPU time”). I created a script that runs into automation section, in 95% of times, it runs using less than 500 miliseconds of CPU time but sometimes it exceeds the 1000 miliseconds. I dont think so but I need try: there is an way (even paying more) to get more time? If it is not possible, what is the best approach to try reduce the time? I mean, what is the part of the code that are “more CPU time consuming” for Airtable perpective? let users = base.getTable('CoreVette'); let reps = base.getTable('Reps'); let refs = base.getTable('References'); let inputConfig = input.config(); let newRecordId = inputConfig["recordId"]; let repsResult = await reps.selectRecordsAsync(); let repsStorage = {}; for (let recordRep of repsResult.records) { repsStorage[recordRep.getCellValue('Email')] = recordRep.getCellValue('Manufacturer'); } let refsResult = await refs.selectRecordsAsync(); let refsSt
Basically I want to know if the current env is an installed custom block or a local development environment?
Is there a way to retrieve specific records without iterating through all the results of a table using table.selectRecordsAsync() or view.selectRecordsAsync()? Something like SELECT / WHERE queries in SQL? Or in AirTable terms, a Filter? This would be far more efficient than having to iterate through returned records checking for the records I’m interested in…
Hi all! I’m an absolute scripting begginer, can I have any support with this which would usually be pretty easy in a spreadsheet but is more challenging in a database. I need to automatically calculate the ‘deductions’ column which is some thing like Filter of {Client A} AND {Workshop ID}: IF(Record No. = 1, 0, IF({Time In 2} <= {Time Out 1} , 0, {Time In 2} - {Time Out 1} )) This assumes the fields are appropriately sorted, where base is ‘Business support admin’, Table is ‘Zoom Calculator’ and fields are ‘Workshop ID’,‘Client Name’,‘Time in’,‘Time out’ Client A records from Workshop ID: Time in Time out Deductions 1 09:28 09:37 00:00 2 09:34 10:16 00:00 3 09:44 10:16 00:00 4 10:18 10:37 00:02 5 10:19 10:37 00:00 6 10:38 10:44 00:01 7 10:40 10:44 00:00 Any help would be greatly appreciated
Hi All, I have the following automation setup using Integromat: Receive new email (in Gmail) upload attachment to Google Drive (Actual Attachment) upload attachment to Airtable (URL of attachment since Airtable API doesn’t accept the actual file) The automation runs and successfully uploads the attachments to Airtable, but sometimes (most times, but not all) it deletes the attachments by itself, for no apparent reason. There is the below closed topic here in the forum that discusses this issue, however there are no solutions. (ORIGINAL - Integromat deleting records by itself ) I was hoping that someone can help with this issue. Thank you
I am currently trying to be a photo review tool for my team. I am using the API to create the records in airtable with an attachment field. The attachment files live on S3 and have proper content type set there but do not have a file extension in the url. When I use the api to create the object Airtable doesn’t recognize the file as a jpeg for instance. I tried sending type through in the attachment array but I received INVALID_ATTACHMENT_OBJECT (because, like the documentation says, type is not allowed). Is there a work around for this issue?
Setup Create a table called “To watch”. Keep the default fields (Name, Notes and Attachments) Get an OMDB API key: http://www.omdbapi.com/apikey.aspx Script Add a scripting block with the following script: // Get an API key from OMDB here: http://www.omdbapi.com/apikey.aspx const OMDB_API_KEY = 'YOUR_API_KEY'; // Shows all the button groups together and waits for a button click // Returns the first button that was clicked async function chooseFromButtonGroups(label, buttonGroups) { output.markdown(`## ${label}`); return await Promise.race(buttonGroups.map(([label, options]) => input.buttonsAsync(label, options) )); } async function addTitle(title) { const info = await fetch(`https://www.omdbapi.com/?t=${title}&apikey=${OMDB_API_KEY}`); const { Title, Runtime, Plot, Poster } = await info.json(); output.markdown(`  # ${Title} ${Plot} Runtime: \`${Runtime}\` `); const table = base.getTable('To watch'); await t
Airtable’s calendar generated ics link does not allow me to control the content of the Description and Location fields in the ics file! I was wondering if some addon exists for AirTable which will give me this ability to add content to the Description and Location fields in the generated ics file? Currently I export 4 fields (Event Title, Start Date, Description, Location) to a csv file, from AT, and then import this csv file to Google Calendars, and then share the ics file link, from google calendar. Google cal supports HTML coding in the Description field which is very nice. The problem I have is the updating of the G Calendar when I make changes in the AT table events. I must empty the GC and then re-import the entire calendar! Slow and tedious. It seems that AT’s ics file and link, will immediately auto update when I make changes in the table. That is what I need. Fantastic! But I also need to control the Description and Location fields in the ics file? Any help will be appreciated
Hi there! I found a minor DX issue in the generated Typescript definitions (which are incredibly cool, by the way). I’ve got a rating field in my base: When writing scripting to update it, I’ve got an await input.buttonsAsync where each item is has a value and label: { label: "⭐⭐⭐⭐", value: 4 }, etc. The selected button goes into a payload object that’s eventually passed to table.updateRecordAsync. The actual script works flawlessly, but there’s a TS error: Type "number" is not assignable to type '0 | 1 | 2 | 3 | 4' I tried to add a type assertion, but apparently the script input isn’t a TS file. I think the fix is as simple as demoting the Rating type to accept numbers instead of a specific set of numbers. Not a big deal, since the error doesn’t affect execution, but I figured I’d flag. Thanks!
Hey, The “ResizeObserver loop limit exceeded” is a completely safe to ignore error. See here. It used to be that the blocks sdk only added a global window on error event listener in development mode so my blocks worked after releasing them. Now it seems to add the event listener in release mode too and displays the “contact developer” message. Can you guys please check for that specific error in your error handler and ignore it? Thanks, Ronen
Hey folks - new here and would definitely appreciate some help. Problem space: I have a table with two columns, column A and column B. Each row of column A has a string, and each string may or may not contain any number of emails. My goal is to extract all the emails (if there are any) from the string in column A and put them in the currently empty corresponding field in column B. Sample Row 1: Column A: “There are a few emails relevant here, and they are jack@gmail.com and ashley@yahoo.com” Column B (if implemented correctly should look like): jack@gmail.com, ashley @yahoo.com In javascript, I know how to implement a basic function using regex to solve this problem: function getEmails(emailString) { var words = emailString.split(" "); for (var i = 0; i < words.length; i += 1) { if (/^.+@.+\..+$/.test(words[i])) { console.log(words[i]); } } } But I’m not quite sure how to implement this using airtable, as I’m getting tripped up on the syntax
Hello everyone! Hopefully I put this post in the right place, but let me know if I should move it to another area. I have been trying to use the community as well as Google to try and find a solution to my problem at work, but don’t know coding well enough (at all really) to put anything together that works. I had an idea that would work out well, but I don’t know if this idea is realistic for the use of a button and scripting. I haven’t been able to find anything similar to it yet. I apologize if I am not including all of the necessary information needed or if parts of this don’t make sense. I will clarify anything that needs to be addressed. If anyone is willing to help out, I would greatly appreciate it!! We have a log that records the materials being used on each specific job. There are multiple material types that we log. Some of these materials we can purchase samples for and the others we need to create in-house samples. For our in-house system we currently are using another bas
Hey everyone - I’ve got a unique use case for a business I’m consulting on, and am curious if Airtable can help me out. Basically I am working for a company that provides product recommendations to its clients. There’s a list of, say, 100 products. Each client is recommended 5-10, and then each client decides 2-3 to purchase. Can I create that entire experience (outlined below) through airtable? Company recommends Customer A a list of 10 products Customer A chooses 5 of them Company handles fulfillment of those 5 products I may not be explaining this well, so please let me know if there’s anything I’m missing!
It looks like free use of Scripting block has been extended another six months! (it was originally going to expire this month.) Will there be a similar extension on free usage of Custom Blocks?
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.