Need development and API help? Ask your questions here!
Recently active
Hey! I am trying to install Airtable block but I end up have these errors: npm ERR! code ENOENT npm ERR! syscall chmod npm ERR! path /opt/homebrew/lib/node_modules/@airtable/blocks-cli/node_modules/loose-envify/cli.js npm ERR! errno -2 npm ERR! enoent ENOENT: no such file or directory, chmod '/opt/homebrew/lib/node_modules/@airtable/blocks-cli/node_modules/loose-envify/cli.js' npm ERR! enoent This is related to npm not being able to find a file. npm ERR! enoent I am using 14.7.6 node on a Macbook M1 with Big Sur. I have tried out the other solutions here but nothing worked for me! Can anyone help me out?
Hi, I have a few automations that do things like set default values for new records and one that randomly generates something. They work fine if I’m adding new records in manually but if I import a bulk CSV with 10,000 records then I get loads of emails complaining that the automation failed. But when i check after a few hours all the defaults are set and everything that needs generating has been. I think what happens is that it sees that there’s so many records and whilst its automating away its complaining that there’s too many to do. This isn’t too annoying as it still works I just get a load of emails I need to archive. But if it genuinely breaks I don’t realise for a while because I just thought the automation failure emails where from someone else doing a bulk upload. In short could Airtable make it so automation failure emails only fire when it actually fails not just when there’s a lot to do and if possible could the error emails contain a bit more debugging info on what went w
I’m having a little trouble with a script I’m using to update a date field in Airtable with data from an API. The API I’m using gives date/time info most of the time. Every once in a while it’ll output a string like “UNKNOWN,” which brings the whole thing to a grinding halt. I’d like my script to be able to skip trying to enter that in and move on to the next iteration in the loop. I’m feeding the data it gives me to a Date() function to save it as a new variable, then I pass that variable to table.updateRecordAsync(). But when the data is a string that can’t be parsed into a date, I get an error saying that the Airtable can’t store that string into a date field. Which is totally accurate and fine, but it halts the whole script. Is there a function/operator or something to check whether a variable/constant/piece of data is in a format that Airtable will accept for a specific kind of field? Thank you!
Hey Everyone, I am trying to understand why is TestDriver returning a “is not a constructor” error. Here is a snippet of the code. import React from 'react'; import TestDriver from '@airtable/blocks-testing'; import roninRecord from '../tableSample/RoninAccount'; import { getRoninAddress, } from '../frontend/Helper Functions/airtable/func'; describe("Get Ronin Address",()=>{ let testDriver = new TestDriver(roninRecord); it("Should return a list of all ronin addresses",async ()=>{ expect(0).toBe(0); }); }); I can confirm I have installed the packages. Unsure what could be the issue. I appreciate any advice :pray:
I am trying to update the Single Select value with an update query. I am tacking the value from another single select field. Values are exactly the same, but it doesn’t update for some reason. Has anyone got the answer to how to do it? But I get an error: Error: Field "fldax5f6gPgS23wMU" cannot accept the provided value. table.updateRecordAsync(${inputConfig.record_id}, { single_select_field: another_single_select.name})
Hey @Taylor_Savage and @Emma_Yeap, The block cli v2 docs state the following: Using code from other directories The new CLI allows this method of code-sharing by allowing “sibling directories” outside the source directory to be bundled. Those other directories can include npm imports based on link or file. What does this exactly mean? More specific setup / how-to instructions and an example repo demonstrating that would be very helpful. Thanks, Ronen Eazyapps
I’m noticing that I can’t use the Airtable API to create/edit columns of type Date. I’m using JS, and when I send in a date, I get the following error: {"error":"INVALID_VALUE_FOR_COLUMN","message":"Field timestamp can not accept value 2018-09-11T17:42:38.000Z","statusCode":422} However, it seems from your documentation that this is exactly how you’d like me to pass a Date string (ISO 8601 formatted date) UTC date, e.g. “2014-09-05”. Any help/ acknowledgment of a bug would be greatly appreciated! Seems like a pretty core piece of functioality to not be working correctly
I’m not too sure where I’m going wrong. The Javascript examples I’ve read indicate that this should work, but Airtable isn’t processing them as I’d hoped - and judging from the results I’ll need to modify my script somehow. Although the Automation triggers at the correct local time, it certainly doesn’t pass the local time as an input into the script - which isn’t a problem so long as we can easily process it to the correct time within the script, which is where I’m stuck. //Trigger executes 7am daily and provides the _input_date to the script, but it is using yesterdays date (even though Airtable trigger states it is using local time?), so attempting to align it with local time via JS below let rightNow = input.config()._input_date; var date = new Date(rightNow); let today = new Date() let string = today.toLocaleDateString() let correct = new Date(string) console.log(date.getTimezoneOffset()); console.log(date.toLocaleTimeString('en-AU')); console.log(correct) Appreciate any hel
Just want to put in a vote for some kind of “import” functionality or js module support for sharing code between automations. I’m resisting the temptation to create a “Modules” table and eval’ing those records into each of my scripts. Please, save me from myself.
Hello, I don’t seem to understand Airtable. I would like to have a Table of Transactions as follows: . TransactionID field is Autonumber Date, Description, Amount, Currency are entered Year is the formula Year(Date) In addition, I have exchange rates between my business currency (HKD) and other currencies, by year: one set of exchange rate for 2019, one for 2020, in the future for 2021, 2022, etc. I would like to have a table that contains the exchange rates for each year, for example like this: Finally, the RateForthisTx Field in the Transaction Table should be the result of a lookup(Currency, Year), e.g., lookup(AUD, 2019), or lookup (CHF, 2020), whatever corresponds to the actual values in a given transaction. I must be thick, but I can’t find a solution Airtable, unless, perhaps, we’d have to resort to Scripts. Once again, a big thank you to anyone who can help. Peter
Hi, Anybody else noticed that the Currency converter scripting block provided as a template when you add a new Scripting App no longer works. The fetch(‘https://api.exchangeratesapi.io/latest?base=USD’) endpoint has changed and also requires an access key. Their api documentation (Exchange Rates API) now shows that the following endpoint needs to be used: https://api.exchangeratesapi.io/v1/latest?access_key = API_KEY This works once you have a valid access key, however, it appears that you can only pull the EUR default base currency on the free plan. When I tried to use ‘&base=USD’ I git the following response: {“error”:{“code”:“base_currency_access_restricted”,“message”:“An unexpected error ocurred. [Technical Support: support@apilayer.com]”}} I am not sure who maintains these example scripts, but this one needs looking at. Anybody know of an alternative api for currently conversion that would be completely free and allow base currencies to be changed? Only very low call rates nee
I have a view that needs the “Grouped By” setting changed every 24 hours. Are there any methods in the scripting block that would allow me to change a view’s group by setting? Alternatively, let me know if there are any apps that can achieve this.
Example Go Program Using API
Is it possible to extend/change webpack config?
How can I get convert the encoded data to actual data shown on the image? Thanks in advance.
Description I wrote this little scriptlet for personal use and thought maybe someone else might find it useful. It fetches the summary of a Wikipedia article in one cell based on a query in another using the public MediaWiki API. example code I’m just starting out programming and I don’t know JS so there’s probably alot of bad practice. I wanted to write it in a more functional way but I couldn’t figure it out how when it’s asynchronous. Feedback welcomed with a smile :grinning_face_with_big_eyes: /* CONFIG */ let queryColumn = 'Query' let resultColumn = 'Wiki' let language = 'en' let table = base.getTable('table'); let view = table.getView('view'); /* SCRIPT */ /* list of all records in view */ let result = await view.selectRecordsAsync(); for (let record of result.records) { let query = record.getCellValueAsString(queryColumn) let seachQuery = encodeURIComponent(query) /* skips wiki request if airtable record has no query */ if (query == null) {continue} /*
Progressing with Javascript and airtable, was distracted with the thought - can I gear a scripting app button to open a link? I know I that the button fields can open links within a base (but annoyingly their labels can’t be configured on a per record basis). The below simply posts the selected link in the output, but is there a method that allows to open directly into a new tab upon clicking the button? let button_test = await input.buttonsAsync( "abc this is a test", [ {label: 'Google', value: 'https://google.com'}, {label: 'Bing', value: 'https://bing.com', variant: 'primary'}, {label: 'Yahoo', value: 'https://ask.com', variant: 'secondary'}, {label: 'DuckDuckGo', value: 'https://duckduckgo.com', variant: 'danger'} ] ) output.markdown(`### Link: ${button_test} `) output.inspect(button_test)
Hi, I am using the useRecords hook extensively in my application, and cannot find an answer in the documentation to this question. The useRecords documentation shows an example of using field options to limit the amount of data loaded from a table like so: // Returns all records in a table, only loading data for the specified fields records = useRecords(table, {fields: ['My field']}); This appears to work, however I am trying to use it with a view like so records = useRecords(view, {fields: ['My field']}); Based on my testing, when used with a view useRecords ignores the fields argument and loads all fields for the records in the view anyway. Can anyone confirm if this is the case, and if so, is there an alternative method to achieve my goal? I need to evaluate one field in the view, so loading the whole view is a waste. I would prefer not to use the table as we are using the view filters to keep logic out of the code. Thanks, Peter Toft.
Did the basic “Hello World” demo app. ie. selected “Add an App” then “Build a Custom App”, selected “Hello World” example and went though installing blocks-cli, doing blocks init and blocks run. I see the " Your block is running locally at https://…" message on my server. I specify the App URL back on airtable’s message box and click “Start Editing App”, but after about a second I get this message: Error running app Error: Disconnected from development server pollForLiveReload/</<@https://XXX.XXX.XXX.XXX:9000/__runFrame/poll_script.js:19:19 (I replaced my IP with “XXX.XXX.XXX.XXX”) When I try with “Simple Chart” example some GUI elements from the app show in the airtable’s dashboard space for that app, bu get the same error again after about a second… Any hints on why this error is happening here appreciated… I’m using demo apps as provided by airtable…
Is it possible to create scripts OR automation on tables using API endpoints? Thanks, Deepak.
Based on template by @kuovonne , I want to use button to run the script. But I don’t want create two buttons. My scenario is when Single Select field is “Not Started”, when I press the button, it will change to “In Progress”. When the field is “In Progress”, then I press the button again, it will change to “Completed”. How do I achieve this? Thanks.
How can I ensure Airtable properly handles dates I write from JavaScript into a Date field? This script pictured below properly inserts the Date retrieved into a Date field as long as I run it before a certain time. If I run it in the morning, for example, I get the date I expect in my Date field. I just ran this at 6:50pm in my current timezone and it entered the date into the date field as if it were a day later: This really has me thinking that it’s an Airtable date display problem, and not a JavaScript DateTime interpreter problem. I have the same issue with this script run as an Automation - Script Action as well. I do not have the Time included in this Date field, and I do not have the “Use the same timezone for all…” option checked: So my presumption is that this field should be interpreting DateTimes relative to the timezone my browser recognizes me to be in, or that my system is set to (and clearly the JavaScript that is fetching the date and displaying it in my script outpu
Hi! Trying to reach Airtable via curl from debian buster. root@689c6c6a3ea9:/app# curl https://www.airtable.com curl: (60) SSL certificate problem: unable to get local issuer certificate More details here: https://curl.haxx.se/docs/sslcerts.html curl failed to verify the legitimacy of the server and therefore could not establish a secure connection to it. To learn more about this situation and how to fix it, please visit the web page mentioned above. Installed last updates of ca-certificates, tried to reload them but it doesn’t help. For now it solved when I manually installed SectigoRSADomainValidationSecureServerCA.crt into debian trusted cert store. Could you please check that issue?
Hi! I’m trying to automatically link records through a script created by @Justin_Barrett (Automatically link record based on plain text or formula result). But I can’t run the script as I get errors in the last line: Property ‘id’ does not exist on type ‘string | SitesTable_Record’. / Property ‘id’ does not exist on type ‘string’ What could be the problem? I have no knowledge about scripting… Thanks!
I’ve been testing out the Scripting block over the past few days. This is the most exciting thing to happen to Airtable…since Airtable :slightly_smiling_face: Does anyone know of a way to make the scripts resilient to changes in a table’s field names? For example, if I have the following code in a script: fname = record.getCellValue(“First Name”); this works great until someone decides to rename the “First Name” field to “Contact First Name” – at which point the script will no longer work. I’m wondering if there is some sort of “internal ID” for a field that stays the same even if the visible field name is changed. Thanks Bill
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.