Need development and API help? Ask your questions here!
Recently active
Hi, everyone - I could seriously use some assistance with a script I’m trying to figure out. Please note, I always thought of myself as efficient with computes and I like to think I’m pretty good with Airtable formulas, but the scripting stuff is so above me it’s crazy… Any assistance would be greatly appreciated. Here’s what I’m trying to do. Table 1 In table 1 I have a formulated field that auto populates with a bunch of comma separated text strings. Any given cell can look something like this. Auto-populated Field TEST_S1_12345_Commercial_15s_[Pre/Post]Master_RecordTest_16x9_XXXX_MV_en-US,TEST_S1_12345_Commercial_15s_Video2_RecordTest_16x9_XXXX_MV_en-US,TEST_S1_12345_Commercial_15s_EDL_RecordTest_XXXX_MV_en-US,TEST_S1_12345_Commercial_15s_Music_RecordTest_XXXX_MV_en-US,TEST_S1_12345_Commercial_15s_GraphicToolkit_RecordTest_XXXX_MV_en-US,TEST_S1_12345_Commercial_15s[Pre/Post]Wide_RecordTest_16x9_XXXX_MV_en-US,TEST_S1_12345_Commercial_15s[Pre/Post]Vertical_RecordTest_9x16_XXXX_MV_
Hello, I am really new to google apps script and pulling data from Airtable, I’m using the code from this post on Medium. One problem I’m having is that every time it pulls from one of my 3 tables it brings in data in the wrong format, so that then Data Studio chokes on it. I added a couple formatting lines to the Apps Script, by hard coding which column to re-format, but then the columns aren’t consistent when they re-import. So, is there a way to pull the data from Airtable locked into the correct format, or am I better off using a column header in Apps Script to identify the formatting changes, and if so, how do I select column based on incoming header?
I’ve been banging my head against the wall for a few hours, I can’t figure out why my selectRecordsAsync() does not pass anything into queryResult. I think it has to do with me using an async function, but not sure why it wouldn’t work? let poTable = 'PO/PI Paperwork' let poView = 'test' let btnPO = 'Client' /////////FUNCTIONS //Show PO list by client///////// const poList = async () => { let view = base.getTable(poTable).getView(poView); let queryResult = await view.selectRecordsAsync(); return queryResult } ///////////UI if(btnPO === 'Client'){ console.log('Client') let test = poList() console.log(test) }else if (btnPO ==='Number'){ console.log('Number') }else if(btnPO === 'Yarn'){ console.log('Yarn') }
Hi – I may be in the wrong place, but if this is possible, am guessing it will be a script. I have a single multi-select field with 450 options like: United States, Automotive, P&L, Canada, Manufacturing My team has gone through and categorized these into 3 new fields which would be: United States, Canada Automotive, Manufacturing 3 P&L We have about 1500 records tagged in the first way. Is there a script I could run, that would redistribute those tags from the single field to the three fields, without creating new options? Please let me know if this should be elsewhere. I searched for similar requests and didn’t find this. Thank you!
@JonathanBowen @Bill.French - From what I’ve read so far, you folks are the people to go to for this question. I’m currently developing a script that I would like to leverage to search a keyword within column and then assign points to that record. To add context, lets say I have a base with a teacher ID in each row and each teacher has 3 classes (columns) with sets of student names in the cells. My goal is to input let’s say “Jane Doe”, and have the script search each column for the name. If the name exists in a cell in Column 1 connected to Teacher-A, then 1 point would be added to the Teacher A Record (in a separate column or variable) So far I’ve been able to write a script that asks for inputs and creates new records in a new table called search results. However, the columns where I’d like to record points per record are not be updated correctly. In other words, I’m not able to search the string within the cell. Was wondering if you could direct me in any direction or if what I am
Hi guys, I have released a new block - “API Connection”. It can connect to any API to fetch the data and save it to your Airtable. I have released it as open source on github - https://github.com/saas-developer/airtable-api-connection . It should help bridge the gap between technical/non technical folks in your team. Do let me know if you find any bugs !! Thanks !!
I see that you can get all records from a table or view - and even sort them. But what if you want a subset - for example all those records connected to another record? It’s not always possible or desirable to create views for this type of thing?
Hi folks, I’m pretty green when it comes to Javascript. I’ve worked with Vue mostly in the past. I’m definitely new to React. Despite that, I’ve managed to hack together a fairly decent custom block for a friend and client of mine. I’m using the Cursor model to display the selected record in my block. I’ve managed to get the input fields to update the record. But I’m having an issue where my inputs are retaining the value from the previously selected record. Here’s a screen cap of what’s going on. Here’s the code for my Input component. import React, { useState, useCallback } from 'react'; import { Input } from '@airtable/blocks/ui'; import { debounce } from '@airtable/blocks/dist/cjs/private_utils'; export default function FieldInput({ onInput, initialValue, ...props }) { const [value, setValue] = useState(initialValue); const callback = useCallback(debounce(onInput, 500), []); function handleChange(e) { setValue(e.target.value); callback(e.target.value); } return
Hey all we use Miro to do our brainstorming and collaborate ideas so theres lots of notes, comments tags etc going on in there. We find it such a good way to start projects. I know there is a board to show whats in Miro but we need to bring the observations over to base as thats how we run the project. At the moment we are double handing - doing it in miro then adding to base later. Does anyone know of a way to get those comments, tags, notes out of miro and into Base - happy to do export/import just trying to reduce the double handling. Ive done a quick video here https://www.loom.com/share/a68af343b4d541a38965f3556df07697 thanks in advance
I want to be able to pick a value which and select some some other values which shows only values that contains values that includes values from first pick. I’ve been trying to play around with options.fields however I’m a little unsure what to put in as a fields value. I’ve tried ID’s and name values but I’m getting an error: ‘No field matching’ let filterArr = [] let filter = await input.recordAsync('Select Sender', base.getTable('Contacts').getView('Mills')) filterArr.push('rectBqFb8f8DtgRLW') let selectRecord = await input.recordAsync( 'Select a record', base.getTable(selectBase).getView(selectBaseView), { fields: filterArr, shouldAllowCreatingRecord: false } ) what do I need to pass as fields value?
Hi guys, I’m using Airtable.js with a base with over 800 records. This is my basic code to retrieve the records in chunks: function updateTable() { table.select({ maxRecords: 800, pageSize: 84, view: "Grid view", filterByFormula: filterDefault, sort: sortDefault }).eachPage(function page(records, fetchNextPage) { buildCard(records); buildModal(records); infiniteScroll(fetchNextPage) }, function done(err) { if (err) { console.error(err); return; } }); } updateTable(); Here’s what happens though. If I use fetchNextPage() by itself, all the records will keep loading when I initialize the page. This is problematic because, as you can see, I have sorts and filters I want to use to redraw the table, but they won’t work well until all the data is loaded (I haven’t figured out how to stop ùpdateTable() halfway). I have added an infiniteScroll to push more records only when I scroll down. However, if a filter is added
Hi, Before I start sharing SNIPPETs or SCRIPTs that can be tried, commented, improved by the Community, I am a bit lost in how to introduce the shared SCRIPT… What is in your opinion the best way to write a SCRIPT HEADER? What are the effects/consequences between no HEADER and a very full HEADER. If you would to take the time to answer me, I appreciate it very much, but please understand me: I am NOT asking these questions about the DOCUMENTATION of a SCRIPT which is another subject that has already been discussed here but about the lines that precede this documentation. Moreover, all the SCRIPTs without header that I use as examples have been documented by their Author’s Threads who also provided the necessary BASE for self-testing. Would I dare to say that my question is only about “legal” aspects ? Examples picked from here: Bill’s way: /* *********************************************************** ScriptBloqs - ScriptChain Copyright (c) 2020 by Global Technologies Corpor
Hi there, I have a pretty good sized, intertwined base. I am hoping to export all of my data and edges (relationships) into JSON. I know I can go through the API to retrieve the JSON, but am a little confused on how to expand the entire database. I know I need to retrieve records and use the offset to get the entire dataset, but I’m unsure as to where to code for this. Thanks!
I would love to create a block that shows only 1 record but bigger. As big as in the summary block. I use blocks as a dashboard displayed on a tv and records in the “Record List” Blocks are way too small. is there a way to write bigger letters in blocks. JS code ? Thanks
For Airtablers interested in the scripting block, I’ve added a few new example walk-throughs to my blog: Setting attachments from URLs Converting scores to ratings Using reduce to sum data Creating records in batches
Hi Airtable! I have an Integromat scenario that uses Airtable API. My understanding is that I would use “List Records” from the table I will use (API), then copy and paste both the URL and Bearer Key into Postman and use “Get”, but when I run the Integromat scenario it requires authorization. It seems that I did get that, but maybe I am missing something. Any suggestions would be appreciated. Thank you, Mary Kay
Hi, I’d like to be able to register a remotely hosted service worker within a custom block in order to activate push notifications. I tried it but I faced cross-origin errors because the iframe is on a different origin from the remote service worker. Any ideas how I could achieve this? Thanks in advance, Fatma.
Hi, I’m using Airtable-js to build a website using my Airtable as a source. Because my table has 800 records, I’ve added a click event before fetching more pages of my table, but fetchNextPage is behaving strangely. Instead of fetching regular blocks (my page limit is 36), each request seems to be multiplied by two, thus first it works, then it returns a duplicate block, and eventually it bloats to the point of hanging. Check the code below. You can see eachPage renders more cards whenever I hit the bottom of the page. function updateTable () { table.select({ maxRecords: 800, pageSize: 36, view: "Grid view", filterByFormula: filterDefault, sort: sortDefault} ).eachPage(function page(records, fetchNextPage) { records.forEach(function(record) { var rc = record.fields; var $dataContainer = $('#data-container'); var $cardAlign = $('<div class="d-flex align-items-stretch col-xs-12 col-sm-6 col-md-4 col-lg-2" data-toggle="modal
Our calendar table has a primary field of type datetime with the local format When using the API to update a link record in our bookings table with the recordId from the calendar, it is displayed in the US format A linked table shows the local format, it is just the lookup table that is wrongly presented In the picture above 3rd record we copied and pasted the date which is then the correct format Is this a bug?
I have a scripting block setup to create a series of 50 linked records when needed. These act as a checklist workflow and are linked to the original project in the other table. My only issue is trying to pull in the Single Select field for City to fill in the 50 linked records. I need the city to pull from the selectedEvent and not the checklist template. // pick tables from your base here let checklist = base.getTable(‘Project Workflows’) let templateView = base.getTable(‘Project Workflows’).getView(‘Expansion Workflow Template’); let templateQuery = await templateView.selectRecordsAsync(); let templateRecords = templateQuery.records; let noChecklist = base.getTable(‘Ongoing Projects’).getView(’**Expansion Projects ALL’); // Select Event to Create Checklist let selectedEvent = await input.recordAsync(‘Choose Event to Create Checklist’,noChecklist); // create the tasks let createRecords = templateRecords.map( c => ({fields: { 'Task Subject': c.getCellValue('Task Subject'),
Hello, I have an Express POST route that creates a record. When I test the API, it successfully creates the record populated with all the right info (I checked the table). However, I receive no response from the API (Postman times out, and in the console I get - - ms - -). Here’s a snippet of my Express POST call. router.post('/submitimportedorders', (req, res) => { importedCarOrdersTable.create(req.body, function(err) { if (err) {console.error(err);} }); }) Would love some help with this. I can also provide more code if required.
Hello! The video snippets block lets you play video files uploaded to an attachment field. You can preview a whole video, or specify start and end times by selecting duration fields containing timestamps. We’ve been using it internally for meeting recordings and user research sessions. In these bases, we have the videos stored in one table, and we have a second linked table (“Nuggets” in the screenshot below). The records in this second table act as bookmarks into specific parts of the videos. → Click here to join the beta. Once you click that link, the “Video snippets” block will be available in the list of blocks when you go to install a block. P.S. The source code for this block is available here, so you can remix it if you’re in the custom blocks beta.
I wrote a formula to find and replace two text strings, and luckily it worked. REPLACE(REPLACE(Description,FIND("<p>",Description),LEN("<p>"),""),FIND("</p>",REPLACE(Description,FIND("<p>",Description),LEN("<p>"),"")),4,"") But I can imagine a situation where I would want to replace more unique strings within another field without using an excessively long formula. Each unique text string makes this formula substantially more complicated. Is there a possibility of adding iterations to the formula field using a built-in array (multi-select field) or custom array such as [1,2,3,7,13] as the input? This would mimic Javascript’s “for” function.
Currently the Blocks SDK creates the deps for the acorn library which has a security vulnerability: Upgrade acorn to version 7.1.1 or later. For example: “dependencies”: { “acorn”: “>=7.1.1” } or… “devDependencies”: { “acorn”: “>=7.1.1” } Always verify the validity and compatibility of suggestions with your codebase. Details GHSA-6chw-6frg-f759 moderate severity Vulnerable versions: >= 7.0.0, < 7.1.1 Patched version: 7.1.1 Affected versions of acorn are vulnerable to Regular Expression Denial of Service. A regex in the form of /[x-\ud800]/u causes the parser to enter an infinite loop. The string is not valid UTF16 which usually results in it being sanitized before reaching the parser. If an application processes untrusted input and passes it directly to acorn, attackers may leverage the vulnerability leading to Denial of Service. The solution is to upgrade the Blocks SDK to use a newer version of acorn.
Hello. I am trying to implement a search functionality using the record id is this possible given that the id isn’t in one of the fields? As an example, I have the following records records: [ { id: “rec2PRjhAMAh2O64a”, fields: { Name: “blah blah”, }}, { id: “rec2otu8JF7ijlmA4”, fields: { Name: "klkdsd ", },] I want to search by the id. Is this possible?
Already have an account? Login
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.