Could someone help me understand scripting for "how to update a field for all records in a table, when a record enters a view in another table?
HERE’S WHAT I NEED A SOLUTION FOR:
I have a “Members” table with a field called “Available Trimester.” I also have a “Trimesters” table that has dates that each trimester goes on sale (There will only ever be 1 trimester on sale). What I’d like to achieve is when a Trimester (based on its sale date) enters the view “Trimester on Sale”, Id like to update the “Available Trimester” for all Members with the linked record to the new trimester on sale.
Anyone who can help with an example script that can achieve this?
Welcome to the Airtable community!
You say that automations only goes to 100 records. Are you referring to the100 record limit on the “Find records” action? If so, that does’t help you because you cannot perform an update action on the results of a “Find records” action, unless there is exactly one record found.
There may also be other non-scripting methods to do what you want, but they would probably involve an additional field or table and will take more automation runs than a single script.
Are you interested in learning how to write scripts, or do you just want this one particular script?
Learning scripting from scratch takes a while and it is better to start with a smaller project. Instead of starting with an automation script that updates a field in all records in a table, start by trying to write a script in Scripting app that updates only one record. Then try writing a script that identifies all of the records in a table, and updates each record one at a time. Then convert that script to update the records in batches of 50. Then try converting the script to an automation script. The scripting documentation has many code examples.
If you just want working code (without learning to code yourself), please let us know and also state if you are looking for free code or if you are interested in hiring someone.
There’s something about this that concerns me about the scalability of this process. As each new record is added to the table (and appears in a view), the load of the process is cumulative, which will result in a continuing expansion of process time. Ergo, while it may work really well initially, it will degrade as the data set grows larger.
It might make sense to share with @kuovonne why new records (assuming they are new) create dependencies for changes across all other pre-existing records. You might find that there are ways to design your data model such that this automation is completely unnecessary. Some of the best performing automation I’ve ever created involved no automation.