Need development and API help? Ask your questions here!
Recently active
Hi, Noob scripter here I’d like to create an automation based on a response from an email, that will trigger an update on my airtable. This is how I want the flow to work. Based on a status I send an email that contains a link for the receiver to click once a job is completed. this link is the webhook I generated via the airtable script. once clicked this webhook updates the status of the airtable record. After doing a lot of reading on the webhook I now understand that you need to create a POST request with an object (excuse my lack of knowledge I’m very noob at scripting) or payload for the webhook to deliver. This has raised a few questions for me. How do I script the payload to be inserted into this webhook for the user. i.e. {"record": Record_ID, "status": "accepted"} Are webhooks unique? because I’ll be sending out unique webhooks and I worry that the URL changes to the last updated record id. Is my logic on the right track with this?
I recently came up with a useful tool for my Airtable toolkit, and I thought I would share it in case others may find useful. On a recent project, I needed to transform a large amount of data into a JSON object for use by external applications. Unfortunately, I quickly ran up against Airtable’s 100,000 character limit on text fields. It occurred to me that if I could find a way to compress the JSON data, I could fit more data into a cell and wouldn’t have to worry about the character limit. There are a handful of javascript libraries out there for text compression, but what I settled on using is the lz-string.js library. It is based on LZW compression, and was designed for use on mobile browsers, meaning that it is fast, and optimized enough to use in Airtable Automations without going over the CPU time caps. Due to its repetitive nature, JSON data compresses very well—results will vary depending on the structure of your data, but with my current data I’m able to fit the equivalent of
I wrote my first script, tested it and it works ! I Used the Script template from " Table optimizer" to convert “wide” table to “long” one. Now I am trying to utilize this script in my Automation routine using trigger and it doesnt run. I coped and pasted script into Automation, but when I test it, it give me error: TypeError: input.config.table is not a function Any help ?
I have written a little vue.js app. I need it to access more than 100 records in my table though. How do I do that? Here is my code.var app = new Vue({ el: ‘#app’, data: { items: [] }, mounted: function(){ this.loadItems(); }, methods: { loadItems: function(){ // Init variables var self = this var app_id = "XXXXXXXXXXXXXXXX"; var app_key = "XXXXXXXXXXXXXXX"; this.items = [] axios.get( “https://api.airtable.com/v0/"+app_id+"/Donor Honor Roll?view=Grid%20view”, { headers: { Authorization: "Bearer "+app_key } } ).then(function(response){ self.items = response.data.records }).catch(function(error){ console.log(error) }) } } }) Any help is appreciated.
Hello, i tried the resp.json, resp, resp.text but the result of my api request hasn’t shown, sometimes it show the redirection:false when i use the resp.json and resp.text it show only “function” const ws = "https://api.writesonic.com/v1/business/content/ai-article-writer-v2?&end_user_id=test1&engine=economy&language=en"; let config = { method: 'post', headers: { 'Content-Type': 'application/json', 'Accept': 'application/json', 'X-API-KEY': 'apikey' }, body : JSON.stringify({ "article_title": atitle, "article_intro": asection, "article_sections": [ 'Tourist information about the city of Vitrolles in the department of Bouches-du-Rhone 13', 'Tourist information about the city of Abbeville in the department of Somme 80', 'Tourist information about the city of Ablon-sur-Seine in the department of Val-de-Marne 94' ] }), data : data }; try {
I’m struggling to pass an empty date to Airtable without throwing an error. My integration is with python, and so far I’ve tried an empty string and Python’s None (i.e. null) keyword. But with the None keyword I run into this error… ‘422 Client Error: Unprocessable Entity for url: https://api.airtable.com/v0/…[Error: {‘type’: ‘INVALID_VALUE_FOR_COLUMN’, ‘message’: ‘Cannot parse date value “None” for field Effective Date’}]’) Passing None to other fields clears the fields correctly so I’m really hoping this isn’t an API limitation where we can’t clear dates? Thanks for any thoughts!
Hi all, I have a form which sends data into a grid view. One of these columns has 7 options as a single select each with a rating number followed by a rating name. I created a column within the grid view that runs a script I wrote which essentially checks the input column and isolates the rating number in the new column for quick data pulls. However as our form inputs increase, I created an automation that would run this script every time a form was submitted and lately I have been getting the 15 mutations error. Would anyone be able to help me review my code and see if I wrote an unsustainable program? let table = base.getTable("Intakes/Submissions"); let view = table.getView("Partner Creator Survey External"); let csat = await view.selectRecordsAsync({fields: table.fields}); for (let line of csat.records) { let csatRating = line.getCellValue("CSAT Creator"); switch(csatRating.name) { case "1. Very dissatisfied": await table.updateRecordAsync(line.id,
Hi. I would like to create a template script that will create a bunch of rows for me. Two fields in my table are single select fields. The fields are ‘Type’ and ‘Image Order’. How do I choose existing values in those fields? See my code below. I’m getting the following error: Error: Can’t create records. invalid cell value for field ‘Type’. Cell value has invalid format: must be an object Single select field value must be an object with at least one of ‘id’ or ‘name’ as a property. // Create three records in the Vendors and Contacts table let table = base.getTable("Detail Page Resources"); let recordIds = await table.createRecordsAsync([ { fields: { 'Type': 'Primary Image', 'Image Order': '1', }, }, // Specifying an empty fields object will create a new record with no cell values set { fields: {}, }, ]); output.text("Created " + recordIds.length + " records!"); //Field 'Type' id is fldulSwbmghIAHeUU //Pr
Hi - I’m new to scripting so hoping this is an easy resolution! I’m making an automation to update a record based on if the values in two different columns are equal. If they’re equal, I’d like to set another column value as one thing (Booked), otherwise set it as something else (Not Booked). In my automation, I find the records I’d like to check and can access their record IDs in the script. I can also get the values of the two columns I’d like to compare (teacherNameList and bookedTeacherList). I’m having trouble accessing the values of the teacherNameList and bookedTeacherList… I know that the first record pairs with the first value of the teacherNameList and the BookedTeacherList – is there a way to put these together and loop through? I think I can do this by accessing the entire table and then finding the recordIDs, and using “getCellValue,” but since I already have the values from finding them in the previous automation step I feel like there’s a better way. I imagine the code s
Hey Y’all, So sometimes I find myself in a situation where I want to do something that sounds simple: I want to link a record to multiple records at a time. Which is usually easy if there’s only one linked record present in a field, but not so much if linked records already exist. For example: Say I want to add Christmas Day to everyone’s PTO requests in the below table. I can’t copy and paste because that will overwrite the existing records and I want to keep those. I can technically update it bulk from the PTO Requests table, but only if I have my People names in a comma separated array, which I don’t. So I’m using a script. I’m sure you can dial this in to your needs a little bit more, but this script works by adding everyone in the People table to the visible records in the Holiday view of the PTO table. Example base here. Script here let ptoTable = base.getTable('PTO'); let holidayView = base.getTable('PTO').getView('Holidays'); let holidayQuery = await holidayView.selectRecor
Hello, Everyone! I’m facing with the strange issue on retreving records on Today Date. Please help me with my issue. I’m gonna filter records on this: $filtered_row = $airtable->getContent( ‘Invoiced’, [‘filterByFormula’ => “IS_SAME({LastModifiedTime}, ‘. $today_date .’)”]); In other words, I’m gonna compare the “LastModifiedTime” field in record with today date. How can I do this?
Airtable Dynamo DB Intergration with API Gateway not working.Throws error Missing Authentication while using fetchAsync. The API works well in Postman.Please help me resolve
My app is reading data from multiple tables, then displays them in context and interconnected. To be able to react to user changes I’m using the useRecords hook, so that updates propagate to the app. When searching why the app loads so slowly I realized that it starts over and over again, with each useRecords hook. Is there a way/pattern to avoid this, while still being able to read all the necessary table data? My code: ... const base = useBase(); // get all necessary Airtable tables const tables = React.useMemo(() => { return { productTable: base.getTableByNameIfExists(Constants.PRODUCTS_TABLE_NAME), costTable: base.getTableByNameIfExists(Constants.COST_TABLE_NAME), contactsTable: base.getTableByNameIfExists(Constants.CONTACTS_TABLE_NAME), conversionTable: base.getTableByNameIfExists(Constants.CONVERSIONS_TABLE_NAME), contributorTable: base.getTableByNameIfExists(Constants.CONTRIBUTORS_TABLE_NAME), }; }, [base]); console.log('tables ha
Hello, Everyone! I have not a big issue on filtering the records by their Last Modified Time field. Here is the code: $airtable = new Airtable(array( ‘api_key’ => config(‘services.airtable.api_key’), ‘base’ => config(‘services.airtable.base_id’), )); $today_date = Carbon::now()->toDateString(); $filtered_row = $airtable->getContent( 'Invoiced', ['filterByFormula' => "AND( LastModifiedTime = '. $today_date .' )"]); This is in the Laravel Controller. But it’s not working, returns the empty array as response. Anybody, help me out. Thank you in Advance!
Hello, i would like to know if my connectivity of importing the axios module javascript is working because i tried this one but it result to blank. await getAxios() async function getAxios() { const response = await fetch("https://cdn.jsdelivr.net/npm/axios/dist/axios.min.js"); const minifiedLibrary= await response.text(); eval(minifiedLibrary) } const ws = "https://api.writesonic.com/v1/business/content/ai-article-writer-v2?&end_user_id=test1&engine=economy&language=en"; let config = { method: 'post', url : "https://api.writesonic.com/v1/business/content/ai-article-writer-v2?&end_user_id=test1&engine=economy&language=en", headers: { 'Content-Type': 'application/json', 'Accept': 'application/json', 'X-API-KEY': 'apikey' }, data : data }; axios(config).then((response) => { console.log(JSON.stringify(response.data)); }) .catch((error) => { console.log(error); });
Hello all, I am a learning developer so hopefully my code is not too confusing. I want to create a form in React that feeds data onto Airtable. Using the Airtable SDK I am able to do it when I insert the API key into the code. const base = new Airtable({ apiKey: API_KEY }).base( "base-name" ) However, if I use process.env.AIRTABLE_API_KEY it gives an error saying: Uncaught Error: An API key is required to connect to Airtable. import { useState } from 'react'; require('dotenv').config() const Airtable = require('airtable'); const base = new Airtable({ apiKey: process.env.AIRTABLE_API_KEY }).base( "base-name" ) const table = base("table-name") const Form = () => { const [firstNameInput, setFirstNameInput] = useState(''); const [lastNameInput, setLastNameInput] = useState(''); const [emailInput, setEmailInput] = useState(''); const [interestInput, setInterestInput] = useState(''); const [phoneInput, setPhoneInput] = useState(''); const resetFo
hi all i have a List of movie with a link to another record Fields that return differents actor to “NamefromActor” field. in my app i have a list of actor and whene we choose one of theme only the movies which the actor is included are shown .i use this api filterByFormula=search(’${NamefromActor}’%2Carrayjoin(NamefromActor)) but now i want to have differents category (action.drama …) and by selecting on category we have only the movie with actor and category that we have chosen. how can i do this please ? (sorry for my english) Thanks in Advans
Hello- I’m new to airtable and new to scripting. wondering if there is anyone who can help guide me: i have a rental company that rents artwork. im trying to write a script so that when i input rental dates i can search “cards” by the ones that are currently out on rental and the ones that are still in stock. im thinking an “if then” script might help… any guidance would be greatly appreciated!
I want to write a small script that updates all status-fields in a given view. Let’s say I have a view with tasks. Tasks have a status-field ( single-select: ‘new’, ‘busy’, ‘done’). My script should update all status-fields for all tasks in a given view. With input.config, I can select the base, view and field (status). But I can’t find a way to select the new value of status for all those tasks. Is there a way to accomplish this? Because I want this script to be as generic as possible, I don’t want to hardcode any values. Idealiter, selecting done should return the id for that field. Something like. let config = input.config({ items: [ input.config.table('selectedTable', { label: 'Table to use', description: 'Pick any table in this base!', }), input.config.view('selectedView', { label: 'View inside the above table', parentTable: 'selectedTable', }), input.config.field('selectedField', {
It seems I can’t use a variable in the method updateRecordAsync(record,{"field": value) In the head of my script, I ask which field needs to be updated. (ps: I use pseudo-code here to keep my question brief. Everything works, except the last line) input.config({ input.config.field('selectedField', { label: 'Which field do you want to update?', parentTable: 'selectedTable', }), }) Let’s say I choose the field status. Then I would like to use something like updateRecordAsync(record,{selectedField: someValue) or updateRecordAsync(record,{selectedField.name: someValue) However, the code above gives an error: j: Field ‘selectedField’ does not exist in table The code only works when I hardcode the field, which kinda defeats the purpose of scripting/automation… updateRecordAsync(record,{"status": someValue}) question: is there some way to use a variable selectedField in updateRecordAsync or do I need to keep the fieldname hardcoded?
I could not find in the API documentation a way to trigger Airtable’s UNDO actions. Is there a way to do this ? It would surely be of a great help for all users. Thanks!
Hi, I’m new to Airtable scripting and figuring this out as I go along. What I’m trying to do is to get a script to count the number of non-empty records for a specific field in one of my tables. This is because this field does have some blank values for some records and I don’t want to simply count all the records in the table. let query = await myTable.selectRecordsAsync({ fields: [myField], }); let recordCount = query.records.length; When I use the script above, I get the total number of records in myTable. How can I add a condition to this so that I’m only getting a count of those records where myField is not empty? Thanks
Hi, I’m testing the script of Airtable and I’m facing the issue with POST request creation. First, I tested my request with Postman and it worked fine. Then I ran the same request with Airtable script and I got failed. let response = await fetch('https://gorest.co.in/public/v2/users', { method: 'POST', body: { "name": "Tenali Ramakrishna", "gender": "male", "email": "tenali.ramakrishna2@15ce.com", "status": "active" }, headers: { 'Content-Type': 'application/json', "Accept": "application/json", "Authorization": "Bearer 84799e2274fa6626356d26d9364fde5320a5d3f1703b6d33a525a1585cbbce65", }, }); console.log(await response.json()); Could anyone help me on this? Thank you!
Hi, I’m trying to make a script to set the single select value when a button is pressed. However, it requires an id. How would I get the id of my single select value? Example of a working script which I’d like to duplicate & set it to another value, the script is fired with a button: let table = base.getTable("©️ Copyright infringements"); let record = await input.recordAsync('',table).catch() await table.updateRecordAsync(record.id, { "Status" : { "id": "sel3MYJB5QL4jKFdg", "name": "Approved internally", "color": "cyanLight2" }, })
Hi, Is it possible find the same rid from array to array2 then push the wordspin values inside the array variable but i can’t use .find as it result to error. let id1 = "recQoA4zwa0xZQVGL"; let id2 = "reckssVy1WsRtWPQs"; let id3 = "recSu7GQqd85dC5go"; let array2 = [ {rid : id1, wordspin : "test1"}, {rid : id2, wordspin : "test2"}, {rid : id3, wordspin : "test3"}, {rid : id1, wordspin : "test11"}, {rid : id2, wordspin : "test22"}, {rid : id3, wordspin : "test33"}, {rid : id1, wordspin : "test111"}, {rid : id2, wordspin : "test222"}, {rid : id3, wordspin : "test333"} ] let result = array2.forEach(function rid(r) { return function (o) { var ref = r.find(p => o.rid === p.rid); if (!ref) { r.push(o); return; } Object .keys(o) .filter(k => Array.isArray(o[k])) .forEach(k => o[k].forEach(rid(ref[k] = ref[k] || []))); }; }); I want my result to look like this [ {ri
Already have an account? Login
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.