Upcoming database upgrades. Airtable functionality will be reduced for ~15 minutes at 06:00 UTC on Feb. 4 / 10:00 pm PT on Feb. 3. Learn more here

Automation using Script to search for related records, find highest number, input into field

Topic Labels: Automations
413 3
Showing results for 
Search instead for 
Did you mean: 

We use a form with our database so that students can post pictures of homework. When completing the form, each student inputs her student ID to create a new record, and attaches pictures of homework. The homework is associated with a specific session. The master table of students and sessions includes a unique “student session id”, but students don’t know it (ie can’t input it into the record). I would like to create an automation that is triggered when a student submits a record to the homework table. The automation would look for all of the “student session IDs” associated with that student ID, find the largest “student session ID” for that student (more recent = highest number), and input it into a field in the record. Can anyone point me to a script that would do something like this?

3 Replies 3

Welcome to the community, @Hilary_Sonstegard!

@Kamille_Parks discusses how to do this at length in last week’s BuiltOnAir podcast:

I’m more of a visual person. Does anyone have code that I could look at, even if it’s not exactly what I’m looking for?