Scripting: Get table from a record or from button press?

I have a base with several tables of school programs that students can sign up for through a Jotform. I do not want to merge these tables into one because each program has various data/fields that are unique to it. However, there are a set of fields that are the same, such as those concerning student personal info (email address, phone number, address, etc.).

I would like a single script that can do some processing on such fields that are named the same across multiple tables using buttons. In scripting, typically I set the table explicitly via something like

let table = base.getTable(“Table Name”);

I am wondering if there is any way I can either:

  • Get the table that a button was pressed in or
  • Get the table that a record exists in

I know I can make multiple copies of a script and just change the base.getTable() part, but I’d rather keep this as a single script that works on multiple tables. Any suggestions? Thanks!

1 Like

A cursor might be what you are looking for.

That’s exactly the thing that I overlooked! Thank you!

This topic was solved and automatically closed 3 days after the last reply. New replies are no longer allowed.