Need development and API help? Ask your questions here!
Recently active
Hi all, Wondering if anybody knows of a workaround that allows one to set user permissions to only allow changes (edit / create / delete record) through code (scripting block in my case). This would come in very handy when you don’t want base users to mess with the content or structure of your base, but would still allow them to add/edit/delete records through the scripting block, therefore enforcing your desired business rules. @Airtable Team, any suggestions? should we expect this feature in the near future? Thank you,
I am a Director at a Boston based ed-tech organization, and looking for an Airtable expert to help us build out our Sales CRM and social media databases. I’d also like to help my team better utilize Airtable and be able to ask specific questions. Most urgently, we need to be able to integrate APIs for Twitter, Facebook, IG, and MailChimp. As mentioned, we also need to develop our Sales CRM (currently using Less Annoying, and wanting to entirely shift to Airtable). Please e-mail me at gabrielle@writetheworld.com if this sounds like a project you can help with. We’d like to get this going by 9/21/20 if possible. Thanks in advance.
I know Sync is brand new, but I think the Custom Apps API should add the following properties: Table model isSynced : boolean, similar to a field’s isComputed property sourceTableId : similar to a MultipleRecordLinks field’s linkedTableId property Additionally: sourceViewId for the source view Additionally: sourceBaseId for the source base Record model sourceRecordId: similar to a MultipleRecordLinks field’s linkedTableId property, but reporting the record not the table Hopefully these won’t be too difficult to implement because boy would they be life savers!
I have an automation in which i get the record from the record update that triggered the automation, i then have an ‘if’ condition in which if the condition i want is true i put an output text that is later sent to the next action which is sending the text output on a slack message. the problem is that if the condition is not true i want to just stop the automation there and then and not send the message on slack, because right now i put the script output as the slack’s message and when the condition is false i get an error saying the automation has failed because of the slack message action (in airtable notification and in email and thats what i want to prevent). so is there a way to stop an automation in the script section or to at least tell it to ignore that failures so i wont get notifications in airtable and email about it? thanks in advance to any helpers.
The Input component is missing onFocus & onBlur handlers, which are pretty useful for e.g. form validation. At the moment the only way around it it is to use refs which gets pretty messy. Current doing this: ... useEffect(() => { if (inputRef && inputRef.current) { inputRef.current.onblur = console.log; } }, [inputRef]); return ( <Input ref={inputRef} value={value} onChange={handleChange} /> ) When I’d love to do this: return ( <Input onBlur={console.log} value={value} onChange={handleChange} />
Hello team, airtable api are failing & throwing random errors, works on local but fails on production… API Code - const Airtable = require('airtable'); const base = new Airtable({ apiKey: 'API_KEY', requestTimeout: 1000 }).base('BASE_ID'); function updateAirtableSheetValues(data){ base('Table 1').create([ { "fields": { "Name": data } } ], function(err, records) { if (err) { console.error(err); return; } records.forEach(function (record) { console.log(record.getId()); }); }); } export default async (req, res) => { if (req.method === "POST") { const { body } = req; updateAirtableSheetValues(body.data); res.statusCode = 200; } res.json({ msg: "Thank you" }); }; Error -
Hi all! I know that I cannot currently link two bases, and I also cannot currently limit permissions within a base to show users specific data, so I’m trying to find a workaround to my problem and am stuck. I have a CRM built for our sales associates with various tables including Client Database, Interactions Log, Tasks, Transactions, etc. There is data I’d like my executive team to see that I don’t want visible in the sales CRM such as summaries of sales by individual person, # of new customers brought in by sales associates, $ amount in sales by person, etc. I want them to view their individual stats, but not have access to view everyone’s sales stats. But, I want to summarize that data to make it visible to the executive team. My thought was to keep my CRM base as-is, and create a second base titled “Executive Base” that would show/summarize the higher-level data. I attempted to make a zap that would create a new record in the Executive Base when a new record is added to the CRM bas
Hi, I have written the following script but it’s giving me an error when I run it. Can someone please point out what I’m doing wrong? let mainTable = base.getTable(“BOOKING DB”); let mainTableRecords = await mainTable.selectRecordsAsync(); let lookupTable = base.getTable(“LISTING DB”); let lookupRangeRecords = await lookupTable.selectRecordsAsync(); for (let record of mainTableRecords.records) ( let lookupValue = record.getCellValue("LISTING"); for (let rangeRecord of lookupRangeRecords.records) ( if (rangeRecord.getCellValue("LISTING") === lookupvalue) let returnValue=rangeRecord.getCellValue("ACCOUNT"); mainTable.updateRecordAsync(record,( "ACCOUNT"; returnvalue )) ) ) )
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?
Already have an account? Login
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.