Skip to main content
Solved

Custom script reading in the identifier of a table's invoked button?

  • December 7, 2021
  • 3 replies
  • 36 views

Forum|alt.badge.img+5

Use-case: As an airtable user/developer, I would like to invoke one custom script from multiple buttons within the same table and my custom script’s logic determines next steps to execute from the invoking button’s identifier.

Does Airtable’s API (or workaround) currently support this functionality?

I’d like to avoid creating multiple scripts for the same action and I’m not “there yet” as far as creating more robust custom apps.

I attempted googling various phrasings of this question as well as referencing the Airtable help docs (and API docs) related to the custom button feature but could not find anything for certain so I thought I’d ask here!

Best answer by kuovonne

Disappointing to hear but I appreciate the response! It sounds like the answer is no, but are you familiar with any attempts to work around this oversight?


If you want to do different things based on which button is pressed, you need multiple scripts.

3 replies

kuovonne
Forum|alt.badge.img+29
  • Brainy
  • December 7, 2021

A script cannot tell which button was used to invoke it. In fact, it cannot even tell if it was invoked from a button field versus the “run” button in Scripting app.

Custom apps also currently cannot tell which button was used to invoke the app.

Note that this is different from determining which record was used to call the script/custom app.


Forum|alt.badge.img+5
  • Author
  • New Participant
  • December 7, 2021

A script cannot tell which button was used to invoke it. In fact, it cannot even tell if it was invoked from a button field versus the “run” button in Scripting app.

Custom apps also currently cannot tell which button was used to invoke the app.

Note that this is different from determining which record was used to call the script/custom app.


Disappointing to hear but I appreciate the response! It sounds like the answer is no, but are you familiar with any attempts to work around this oversight?


kuovonne
Forum|alt.badge.img+29
  • Brainy
  • Answer
  • December 7, 2021

Disappointing to hear but I appreciate the response! It sounds like the answer is no, but are you familiar with any attempts to work around this oversight?


If you want to do different things based on which button is pressed, you need multiple scripts.