Need development and API help? Ask your questions here!
Recently active
I need to know how i ask to run script when new record is created and define if name in: var response = await fetch('https://api.agify.io/?name='+name); is equal to Prénom used from table else only change records only for this person. I give you a screen of my table // query for every record in "trombinoscope" let table = base.getTable("test"); let view = table.getView("Donnée brut"); let query = await view.selectRecordsAsync ( { sorts: [ // sort by "Prénom" in ascending order... {field: "Prénom"}, ] } ); let records = query.records; // print ID & "Prénom" from each record: for (let record of query.records) { let name = (record.getCellValueAsString('Prénom')) ; let response = await fetch('https://api.agify.io/?name='+name); /*fetch('https://api.agify.io/?name='+name) ;*/ /*console.log((await response.json()).age);*/ let agifyAge = (( await response.json()).age); let records = query.records; for
Hi, Is there a way to Programmatically(*) Hide / Show Field(s) - Add / Modify FILTER to an existing VIEW ? Same question came into my mind about: COLOR & SORT. Best, oLπ (*) = by SCRIPT Block.
Can I get a second pair of eyes on my script? Expected behavior is that a user can click a button on any record in the “People” table, and it will create a record in the “Payouts” table, linked to People by a lookup field called “Person” I don’t get any error messages when I run this script, but I also don’t get any new records in the “Payouts” table. And I’m the only user on the license, so I don’t think it would be a permissions error. Can you see anything I’m missing? Thanks in advance! const childTable = base.getTable('Payouts'); const parentTable = base.getTable('People'); const parentRecord = await input.recordAsync('Parent record', parentTable); const linkField = 'Person'; const newRecordValue = parentRecord.getCellValue("Account Balance")*(-1); console.log(newRecordValue); childTable.createRecordAsync({'Amount': newRecordValue, linkField: parentRecord});
Is is possible to have a button perform a script to input values into other cells all in the same table?. For example, if a field is set to button and you click the button, then do the following: In the Columns “Sales” and “Orders” place data from Column “Estimates” Thanks
The code works fine without using Airtable SDK. Any ideas on what can be causing this? You can see it working here: vibrant-snow-m8sl6 - CodeSandbox Here’s my code using Airtable’s initializeBlock() : import React, { useState } from 'react'; import { initializeBlock } from '@airtable/blocks/ui'; import { Dropdown, Field, Menu, Item, Select, Label, } from '@zendeskgarden/react-dropdowns'; interface IItem { label: string; value: string; } const items = [ { label: 'Fern', value: 'item-1' }, { label: 'Snake plant', value: 'item-2' }, { label: 'Rubber tree', value: 'item-3' }, ]; const App = () => { const [selectedItem, setSelectedItem] = useState(items[0]); return ( <Dropdown selectedItem={selectedItem} onSelect={setSelectedItem} downshiftProps={{ itemToString: (item: IItem) => item && item.label, }} > <Field>
Hi Airtable Team, Based on above screenshot, is it true Airtable doesn’t support API for chart?
Hey all, I’ve tested a simple script that takes two Rich Text fields and copies them into a third field, and excitingly the Markdown format keeps as I’d hoped. :partying_face: My next step is to now have two tables in a base, a primary table that has field lookups to the secondary table. And then any lookups added to the primary table record - to have their single Rich Text fields (in the Secondary Table) combined into the Primary table Rich Text Field. I’m basically substituting the Airtable RollUp formula due to it lacking support for Rich Text, as although the Rollup works unfortunately it drops all formatting (and I’ve since written a support request to address this). Here’s my work so far, keep in mind I’m still learning JS so this is all new to me. I understand some of the basics, but am struggling to understand the syntax of how to place the Lookup Name values into a For Loop, and then assign each of their Rich Text contents to a variable that I then combine into the Primary T
AND filterbyformula does not filter bring up all records instead. Anyone have any ideas? let step_count_records = await log.selectRecordsAsync({ filterByFormula: `AND(( {Email} ="` + email + `"), ({Action} = "` + status + `"), )`, });
One of the inputs to my script is a string which needs to be reformatted such that it will be an acceptable value for a multiselect field when creating a new record. There are three possibilities for the string: “option 1” “” many options: “option 1, option 2, etc” I know the format below is what I need to convert it to, but I can’t figure out how. await table.createRecordAsync({ “Multiple Select Field”: [{name: option1}, {name: option2}, etc] }) I’m omitting all the things I’ve tried which haven’t worked. I’m going to use the create records action instead of a script action until I can figure this out. Below is the skeleton of the script action I was using with some ??? where I was stuck. Any help would be greatly appreciated! In the meantime, I’m leveling up my Javascript skills. let config = input.config(); let recordID = config.recordID; let table = base.getTable("Table_Name"); let view = table.getView("View_Name"); let query = await view.selectRecordsAsync({ fields: ["Strin
Hi so i have a airtable table and it has date and time field. I wanted to use those value for time for calculation condition and date for comparison basically i want if else based on date and time values. How can i use that? i used JavaScript functions for that but still i cannot get my desired output. Please someone help me out here. IT IS VERY URGENT pls.
I have a problem in fetching the github api using this code and the error show is Response status 301 ‘Moved Permanently’ but redirect mode was set to ‘error’. I’m new on the airtable scripting environment and I don’t quite sure how to make this successful. let response = await remoteFetchAsync('https://github.com/google/google-api-javascript-client.git'); let x = await response.json(); console.log(x); Thank you.
I have a button/script that I want to be a toggle the value in a single select field. If the value is blank, I want to e button to mark it “Absent”; if the value is “Absent”, I want the button/script to make the cell blank. In Airtable Scripting, I see how to delete choices, but I don’t think I want to delete the choice, just the value. (I am trying to avoid having a second option of “Present”, as I know my users will assume they have to mark all clear cells as “Present”.) Here’s my script: // Select the recordId that houses the button let tableClassReg = base.getTable("Class Reg"); let record = await input.recordAsync('',tableClassReg).catch() //console.log(record.id, record.name); // read in a specific field let entry = record.getCellValue("D1 Atnd"); // toggle that field if (entry.name=="Absent") { await tableClassReg.updateRecordAsync(record, { 'D1 Atnd':{"name":""} //<-- here's the problem }); } else { await tableClassReg.updateRecordAsync(record, {
Is it possible to programmatically with Airtable scripting load a different base from the one in which the script is running? I’d like to automatically sync views from one base to another with the scripting block, but it’s looking like that might not be possible?
I configured an Airtable automation script to trigger when a record matches some conditions. I had expected to somehow get an “input” containing the said records, but it feels like there isn’t such thing. My goal is to perform processing for the said records only. I didn’t find anything in the API reference Airtable Scripting. Is it possible? If not, what’s the recommended way to about that? I’m thinking about iterating over all elements and check if some field is empty and if so then perform some processing for that record. Also, I read that only 15 records can be updated per second, how does this work? Is it handled by Airtable automatically or do I need to temporize the updates myself so that I don’t go over the limit?
Is there a way to lock the shared URL in form view? I would like to maintain a URL link so no collaborators can generate a new one accidentally. We use this URL as a QR code internally.
Getting this notice while developing an app. What does this mean?
You’ve probably all seen the following warning by now: I’m guessing the deprecated behavior might still work well into 2022, but if you want to future-proof your scripts right now and/or depend on the old behavior, here’s the cleanest, functional way of mimicking it I’ve found so far: const table = base.getTable(yourTableName), fields = table.fields.map( f => f.name), query = await table.selectRecordsAsync({fields}) This particular destructuring syntax obviously depends on your scope being clean. But in practice, I’d usually just write this: const table = base.getTable(yourTableName), query = await table.selectRecordsAsync({ fields:table.fields.map(f=>f.name) }) Either way, I figured I’ll share this and ask if anyone has figured out a quicker method.
When embedding Airtable’s view iframe into my page, the chrome console prints A cookie associated with a cross-site resource at https://airtable.com/ was set without the SameSite attribute. It has been blocked, as Chrome now only delivers cookies with cross-site requests if they are set with SameSite=None and Secure. You can review cookies in developer tools under Application>Storage>Cookies and see more details at https://www.chromestatus.com/feature/5088147346030592 and https://www.chromestatus.com/feature/5633521622188032. I think this is expected due to the Chrome update in Feb: https://blog.chromium.org/2020/02/samesite-cookie-changes-in-february.html Any plan for Airtable to get the iframes updated?
I have a status column and when i change it to active or passive, i want to send silent webhook to selected URL including another cell’s value. I couldn’t find how to do that. Can you please help? Thank you
I’m using the “Gantt auto set dates” from the Marketplace. I’m trying to figure out how to update it to only act on a particular project. Right now, every time I run it, it will update every project whether I want it to or not.
Is it possible to add additional fields in existing table from a webapp that i create on top of Airtable?
Hi, Is there a script that finds all errors in a specific table (or even better in the entire base) and then returns those error fields? That would help greatly with troubleshooting larger bases, so I don’t have to scroll through hundreds of fields looking for the red error sign when making larger changes.
I tried to search for this topic and could not find any answers. I am trying to know if it’s possible to create a search page and when that record is available, I can manipulate the layout of the result? I am using the pro plan.
We are using Airtable to support City activation of volunteer resources in the event of a disaster or other community-wide emergency. We have fiber optic loops around the city to critical locations. If the public internet goes down, we would like to have our Airtable data stored in our local servers, which have their own redundancy, security, and back-ups. Is this possible to arrange with Airtable?
Hello! this is my first time using the scripting block and first time trying to use an API with code (I’ve used lots of no-code tools in the past; Zapier, Integromat etc.) I want to use a text field in my base to create a ‘tag’ in Toggl using the Toggl api; The Toggl API documentation looks good, and I think I understand most of it, but I don’t know how to actually start - what is the first think I need to write? All the toggl examples start with ‘curl’ e.g. curl -v -u 1971800d4d82861d8f2c1651fea4d212:api_token \ -H "Content-Type: application/json" \ -d '{"time_entry":{"description":"New time entry","created_with":"API example code","start":"2012-02-12T15:35:47+02:00","duration":1200,"wid":31366}}' \ -X POST https://api.track.toggl.com/api/v8/time_entries Is this what I would paste into the script editor? I assume I need the toggle api url somewhere ( api.track.toggl.com) so the script knows where to get/post the data but I don’t know where or how to add this url. Can someone plea
Already have an account? Login
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.