Save the date! Join us on October 16 for our Product Ops launch event. Register here.
Dec 10, 2021 01:12 PM
Hello,
I am trying to figure out how to run the Field Tweaker scripting app whenever a record is created on a particular table. I have the app working successfully manually but I have not been able to figure it out thus far as part of an automation. I am assuming the code has to be changed slightly to reflect which field I want to tweak and what case but I am not sure if there is anything else I am going to need to do.
Any help or pointers would be greatly appreciated!
Dec 11, 2021 11:52 AM
The Field Tweaker script was written before scripts could be run in automations. It was also designed to alter multiple records at once, not just one record. Enough of the script would need to be changed (either added, removed, or altered) that you might be better off starting from scratch.
Do you have experience writing code and what is your interest level in learning how to write Airtable scripts? If you want to learn to write Airtable scripts, this could be a good beginner project.
Dec 13, 2021 04:49 AM
Ah okay that makes sense.
I do not really have any experience writing code I have mostly been copying and pasting but I am reaching the limit of the effectiveness of that strategy and am in a position where I am needing to be able to do more. So my interest level is high for sure.
Dec 13, 2021 07:29 AM
Awesome!
Learning to write Airtable scripts involves (1) learning JavaScript, (2) learning the Airtable Scripting API, (3) knowing how to break down your tasks into smaller and smaller units until they match JavaScript and/or Airtable Scripting functions, and (4) debugging.
I recommend using Scripting App (versus Automation scripts) to start out because dealing with input/output is much easier in Scripting App. I also recommend starting your script with a completely blank script for your learning process and adding on from there, versus starting with an existing script written by someone else.
Stage 1:
Start by writing a script that can input a record, save the current cell value for the field to a variable, and then output the value of the variable. Since this will eventually be an automation script, use console.log()
for your output for now. You will also want variables for the table and the record.
Stage 2:
Then add code to that script that tweaks the value of the variable as you want. You might be able to copy a couple of lines from the original script for this. Output the tweaked value using console.log()
Stage 3:
Add code to the script to update the original record with the new value.
Stage 4:
Finally, convert the script to work as an automation script. You will need to learn automation input variables and how to get the record values from the input variable.
Jan 27, 2022 05:06 AM
Hello,
Did you manage to write this script for your automation?
I’m looking to do the exact same thing I reckon, would you be open to sharing your code?
Thanks!
Jan 27, 2022 05:38 AM
Rickileigh,
I was not able to figure it out unfortunately. I have opted to run it manually for now.
Jan 27, 2022 08:23 AM
If you’re looking to title case your things try this in your fomula field: We still need a simple TITLE CASE (PROPER) function alongside UPPER and LOWER - #6 by gxjansen