Need development and API help? Ask your questions here!
Recently active
Hello, I try to test scripting but i have a generic error that really doesnt help me to find the solution :slightly_smiling_face: “There was an unexpected error while executing your script.” let table = base.getTable("Max"); let queryResult = await table.selectRecordsAsync(); let record = queryResult.records[0]; console.log(record.getCellValueAsString("Rue")); My goal is to have a trigger where i get the new row & do several things
Using a script, what is the syntax for clearing a value from an existing record in a single select field?
Hi everyone, I’m trying to write a script here to do a thing but I’m not a coder. I can usually reverse engineer examples to get by but right now I’m coming up short. Here’s what I"m looking to do. I have Table A Table A has records for projects taco, sandwich, and cereal. The base has tables corresponding to each project and share the same name. Tables taco, sandwich, and cereal have records for each project update, most importantly the Notes field. For each record in Table A, I want to grab the latest record from the table that matches the record name and display the Notes field content in a field in Table A. I figure I’ll put this in an automation that runs when Table A is opened. I can make various parts of my intent work but I can’t put it all together. Can any of you epic geniuses help out?
Hi guys, can I ask you to expose launch mode in the script? Reason: I have a huge table and the current script from Apps does await input.recordAsync() from filtered data to speed up the selection(e.g. filters out records with past Due Date, ‘not ready’ status, etc.) I found that Button may be a nice addition if you want to initiate the script from any record. But it has limitation: Can’t use record from button field To use records from button field with input.recordAsync, use a Table or View as the source. So, with session.launchMode I can modify the script to ask input.recordAsync() just from the full table and use filtered records if I launch the script from Apps. Best regards, Maks
Hi, I need to know if this requirement is possible. I using Airtable with API and currently I have multiple table link to each other. The issue is the order of the data linked is important for me. For example: in the image attach, I want to link the data with certain order by using its data. tm_26137 -> days = 3 tm_29311 -> days = 5 tm_29311 -> days = 7 I want to arrange the linked data based on the days value, lets say I want in days descending value. Is it possible? this is to minimal the code effort. Thank you in advance
I have a script that’s currently working to create one record on my Project/Yarn junction table, but I need it to create multiple records, one per linked cell value in Yarn (from stash), if there are multiple of these. I’ve had a looked on the forums but am struggling to find the solution, can anyone help? This is my current script: let table = base.getTable(“Projects”); let record = await input.recordAsync(‘Select a record to use’, table); let populateTable = base.getTable(‘Project/Yarn’); if (record) { await populateTable.createRecordAsync({ “Project”: [{id: record.id}], “Yarn used”: record.getCellValue(‘Yarn (from stash)’), }) output.text(Record created: ${record.name}) } else { output.text(‘No record was selected’); }
I’m trying to add more intelligent time support to one of my bases, so I went looking for a free time API that I could query, and I found this: worldtimeapi.org World Time API: Simple JSON/plain-text API to obtain the current time in,... It looked like it would fit the bill, so I built a quick test in the Scripting app. However, I hit a CORS-related error, so I shifted testing to a script action in an automation. While I’m no longer getting an error, I’m also not getting the response I’m expecting based on the examples on the above site. Here’s my simple test based on the first example shown on the homepage: let result = await fetch("http://worldtimeapi.org/api/timezone") console.log(result) This is supposed to return a full list of timezones, but this is what the console shows: I’m still relatively new to calling APIs, so it’s possible I’m missing something basic, but I’m not sure what it is.
We’re excited to announce a new input method for the scripting block: input.fileAsync ! This enables script users to upload files, which the script can then use to do things like create or update records. If you’ve ever wanted to preprocess the data in your files before importing it to your base with the CSV or XML import block, you can now do so with input.fileAsync ! Because you can access the file contents from inside the script, you could also do things like conditional record creation or custom fuzzy matching to update existing records. We’re excited to see how you can use this to empower your scripts! The returned value from the file input gives you access to the uploaded File itself, as well as the parsed contents of the file (if supported). Currently, parsing is automatically performed for .csv, .xls, .xlsx, .json, .xml, and .txt files, giving you immediate access to the underlying data. Check out the full documentation for input.fileAsync in the API reference inside the bl
I am looking for the simplest way to get the raw data from my table fields into my static HTML page(s). I am using iframes right now but cannot style with CSS… Unfortunately, I only know HTML and CSS so the API documentation is over my head. Looked for videos on this and they all seem to use various third-party apps that I do not have or know how to use. Please help! Thanks, Bill
I am trying to search for research applications on district websites and have all the website URLs in one column and keywords for research applications in another. Is there a way to modify the existing script for searching the web for keywords to only search specific websites?
Hi Community, I have a table ORDER of n orders with the {fields} : order-id, product, quantity, delivery-date Airtable SHOP - Airtable Explore the "SHOP" base on Airtable. I am trying to use a script to group_by (product, delivery-date) in order to sum the field {quantity} of a group (total-quantity) Then: with Automation, create a record in a table GROUP-ORDER with the fields: order-group-id, delivery-date, product, total-quantity Example on how the results should look like, is shared in the link above. I’m a little knew to the Scripting App (and my skills in javascript are medium). Is this approach feasible? and how should I get started? I managed to group the fields with a script as in : I need help for solving a problem on the script block However, I am struggling to create a new group-order record in a separate table. Thanks!
Hi there I currently use airtable as my delivery fulfillment hub for virtual video game items where I have multiple staff take and fulfill orders via Kaban View. The process is the record comes into a view and the first person who changes that operator name to theirs gets to take that order. The problem comes where there is latency and multiple people click and take that order within the same second, it will override the true initial person to change the field, also its possible for them to change it after the fact (the airtable history does not work well if it all happens within the same second or one staff has higher latency then the other i think) I want to know if this is possible to build then I will look for an app developer to help. The problem comes with latency, the app would need to have some parameters built into it where it will know what the field was changed to FIRST then override and prevent it from being changed again within the next few seconds Would love to hear your
Hi, I’m trying to use the API encoder to find if a value exists using filterByFormula, and in response get a certain string if it exists and another string if it doesn’t. This is where I’m at but it seems it’s not the direction IF(FIND(“5z”,{Field 6})=0, “DOESNT”, “EXISTS”) Any ideas?
How do I get the all data ( Pictures) from Google forms >> Airtable. Or Forms >> Google Sheets >> Airtable. Either way I want to see the question and picture or audio/Video included. Is this possible? If so, how would I go about building these scrips or connection successfully?
I have a list of names of people enrolled in my class. Is there an easy way to place them into randomized groups of 6? Ideally, I could do this to have gender-balanced groups. Any suggestions would be welcome. But then, I also would like it to have prevention such as, if they answered yes in not being in Madrid, please put on the same group. Groups [ Group 1, Group 2, Group 3, Group 4, Group 5, Group 6, Group 7, Group 8] I.e., If value for In Madrid? Yes, automatically add to Group 8, otherwise, randomly add to another group, but don’t allow more than 6 records to be assigned to each group. Ideally, I want to assign a record (name) to a different group every week, and would eventually want to create a new row of groups, where the record (name) is assigned to different groups, but make sure it’s not the same as the previous group assignment. I hope this makes sense! Adriana
hoping for some help/feedback on the following error. below the error i’ve pasted the portion of my script getting the error. The script was copy/pasted from a scripting block into an automation script. i ran a compare and the script is identical to the scripting block script: TypeError: Invalid arguments passed to output.set(key, value): • value should be a JSON-serializable type, not undefined at main on line 27* 21 const query = await new_submissions.selectRecordsAsync(); 22 if(query.records.length === 0) { 23 output.markdown(“No submissions to load. Done.”); 24 return; 25 } 26 27 output.markdown(Found *${query.records.length}* submissions); 28 for(var i in query.records){ 29 let r = query.records[i] any help would be appreciated
I can get records sorted by some field like below const records = useRecords(table, { sorts: [{ direction: 'desc', field: actionField }], }); but how can I get records sorted by manual order?
I’m trying to batch update records using the Scripting app. I’m able to update one-by-one using this script: // set the table let productsTbl = base.getTable('PRODUCTS') // get the table records let products = await productsTbl.selectRecordsAsync() // loop through the records for (let record of products.records) { // set variables to the record values let recordID = record.getCellValue('ID') let option1Name = record.getCellValue('Option1 Name') let option1Value = record.getCellValue('Option1 Value') let tags = record.getCellValue('Tags') if (option1Name === 'Pattern') { let id_pattern = '[pattern:' + option1Value + ']' + 'id_pattern:' + recordID + '_' + slugify(option1Value) let newTags = id_pattern + ', ' + tags await productsTbl.updateRecordAsync(record, { Tags: newTags, }) } } function slugify(string) { const a =
Hi I’m trying to send a POST request to Airtable with two properties: Name (String) and PostedBy (Lookup field). I keep getting an error unless I remove PostedBy. A new row is created but it is empty. My json looks like this: { "records": [ { "fields": { "Name": "${name}", "PostedBy": "${user.id}" } } ] } Any Ideas?
I got a script to work, am quite pleased with myself and thought I’d share it. I was also guided by some other posts here (in particular this one) though I didn’t fully understand it. I haven’t coded for many years, and never in javascript. This script runs through a list of job bookings at various properties (for cleaning services in this instance). It is useful for each booking to know when is the next booking for that property. The script runs through all bookings in the scheduling window (limited by view). For each job it finds all other jobs at that property. It runs through all those jobs in order to find the very next one if it exists. If so, it links the current booking to the next booking. All this is needed because bookings come in in no particular order, and there are often lots of cancellations and adjustments before the job gets done, and because the actally cleaning is often scheduled long after the bookings come in and can be done any time between one job and the next. S
Is is possible to do multiple layers of filters within for loops? What is the best way to do this, otherwise? So for instance, I am taking a survey, finding matches for that survey and then needing to do counting for those matches from a different table. There are at least three tables I am filtering by along the way.
I’ve been trying to query an API, it works using POSTMAN but when I try and replicate in Airtable I get an error message. let response = await fetch('https://api.xavier-analytics.com/clients', { headers: { 'Authorization': 'Bearer XXXXXXXXXXXXXXXXXXXXXXXXXX', 'Content-Type': 'application/json', 'Access-Control-Allow-Origin': '*', }}); console.log(await response.json);
Hi there - This is working but I would like to filter by two things - the client as well as the session: let f_thisclient = result2.records.filter(f_record => (f_record.getCellValueAsString(“Client_Email”) ==v_this_client_string ) ); Is it possible?
Hi there. Just wondering if someone knows if this is possible: Make a search box on a webpage where users can search in a airtable base using the api show the resulting hits and depending on some easy parameters give the user a “yes you can aply” or a “no you cant aply”
Hi there - I am wanting to do something similar to the Task from Template except when I am pushing, I want to have done a count that shows up in a different field. I am needing / wanting to see if there is an efficient way to check the list of what would be the template ‘Tasks’ and then go through and find matching entries and do a count (like finding the average time spent previously) and then pushing that to the table. I am not sure if it’s better to loop, or do an update, etc. I’d like it fully automated so we can change and adjust things as we go. Link to the base is here: https://airtable.com/tblqT5vq9owm1wx2S/viwA1XTRfGpdZLrlY?blocks=bipbsFnhKmDB62OIL
Already have an account? Login
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.