Need development and API help? Ask your questions here!
Recently active
Hey! First time here. Guys, I need the Airtable API to return an array on this format: But the only way I could make it return was in 2 separated arrays, like this: Is there anyway to return it like the first image? Thanks in advance!
Hey there, I would love a bit of help with an issue I have been struggling with: I have large data set containing keywords / descriptive tags to describe/classify the designs on our webshop juniqe.com, they are stored on a table called Image Keywords in my base, whereas the designs they are related to are on a table called DESIGNS I wrote the script below to merge the duplicate entries in the keyword table, since these records hold much information other than the linked record to DESIGNS. I’d like to believe that the script does the following cycle through all the records and compare the current records main field to the others, using the field Name (EN) as comparison value (the keywords english translation) If a duplicate has been found, combine the linked records of both the instances the script has found, and write them back to the first instance Clear the linked record field of the second instance (the comparison record) and mark that record with a checkbox field called DUPE to in
Hello, first of all, the Airtable API documentation is great. That said, closely following the example code, i’m trying to understand how I might do something functional with the retrieve method. Here is the example I am given from the API docs for my table ‘Users’ base('Users').select({ // Selecting the first 3 records in Grid view: maxRecords: 3, view: "Grid view" }).eachPage(function page(records, fetchNextPage) { // This function (`page`) will get called for each page of records. records.forEach(function(record) { console.log('Retrieved', record.get('ID')); }); // To fetch the next page of records, call `fetchNextPage`. // If there are more records, `page` will get called again. // If there are no more records, `done` will get called. fetchNextPage(); }, function done(err) { if (err) { console.error(err); return; } }); What i’d like to do is wrap this example up in a function and return an array of all records. But I don’t see
Hi, Is it possible to return the Linked table children of a table from List Rest call? At the moment a list call seems to return an array of Id’s - is it possible to expand that to include the data from the linked table? The only solution I can see is to iterate through the array of ids and make a Retrieve a Record call for each id of the Linked Field… e.g. in Ingredient below it returns the an array with Id:recEehttf17ZzJYwq… Could that expand to include the fields from the linked table Ingredient? { “id”: “recxTeOfNbAhcTPYS”, “fields”: { “Id”: 1, “Ingredient”: [ “recEehttf17ZzJYwq” ], “Price”: 14.5, “Date”: “2017-04-01T11:44:00.000Z” }, “createdTime”: “2017-04-01T10:40:34.932Z” } Thanks, Andrew
I have developed a Custom App locally, which I am able to run in development mode using block run in my base, however, after running block release, the custom app is not available in the Custom Apps modal, and rather than showing the custom apps menu item, the menu items says Build a custom app, indicating that there are no available custom apps for the base. Is there anything obvious that I might be missing? The block release process seems to run successfully: building copying package.json file copying package-lock.json file installing node modules [npm] [npm] > core-js@2.6.12 postinstall /tmp/airtableBlocks/build/1632423151219/transpiled/user/node_modules/babel-runtime/node_modules/core-js [npm] > node -e "try{require('./postinstall')}catch(e){}" [npm] [npm] [npm] > ejs@2.7.4 postinstall /tmp/airtableBlocks/build/1632423151219/transpiled/user/node_modules/ejs [npm] > node ./postinstall.js [npm] [npm] [npm] > fsevents@1.2.13 install /tmp/airtableBlocks/build/163242
Hey there, Apps should be able to offer a similar pricing model to airtable’s, which is a workspace based pricing model that charges per workspace user. To all app developers, if you’d like support for this too, please like this post :pray: . The following apparently simple features are missing from the current apps sdk in order for us app developers to offer that: Add base.workspaceId to the base model. Without that, a lot of code will need to be developed by apps to try and “guess” and/or ask users if another base belongs to the same workspace and should be added to the same subscription. Add CollaboratorData.isWorkspaceCollaborator or base.workspaceCollaborators so we can enable billing features only for workspace collaborators. Since airtable charges only for collaborators with owner, create, edit and comment permissions, add CollaboratorData.permissionLevel to the collaborator model. Without that, apps will be able to charge per user only after first time app use, after
Trying to add indicated number of days to date via scripting. But the system gives an error. Anyone has any clues about what is wrong? Maybe the DATEADD function is available to formulas only and is not available for scripting? ReferenceError: DATEADD is not defined Code: let current_date = new Date(); let date_added = DATEADD(current_date, 7, 'days')
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.
Already have an account? Login
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.