Script for Button column type for each row

The Button column type is a very useful feature that I am keen to use in a variety of ways. However, I see that I am able to use only one script for an entire column although each row gets a Button of its own. The ideal usage for me is to be able to run a different script for each row. Or, alternatively, be in a position to programmatically identify the row where each button resides and execute the same script . As a generic example, I have a column X which I would like to modify and I would like to run a script which increments the cell value in this column based on clicking the button in that row. I don’t want all cells in the column to get modified but only the one in the same row where I click the button. I have lots of rows and am unable to achieve this in one script. I am using Javascript. Any suggestions?

I have three suggestions for you:

  1. The easiest (and free, see below) way to implement your idea is to have multiple button columns and each button executes a different script. In each table, you can have up to 500 columns. So you can have hundreds of buttons each linked to a script.

  2. The little bit complicated way is to write such a script that it has a filtering function inside, if the row fits the filter, it’ll execute something, otherwise do nothing. The advantage is that you only have one button column; the disadvantage is the difficulty to write a longer script.

  3. The most comfortable (but not free) way is to use the automation rules, where a Python script will be executed when a filter condition is met. As it’s fully automatic, the processing will be carried out as soon as a row fulfills the filter. This feature is but a paid feature in the Enterprise plan.

I just realized you have used the “Bugs & Issues” tag for this topic. As it’s not a bug, I’m moving it to General.

Thanks for clarifying… very useful to know about the automation rules in the Enterprise plan. For the moment, I will experiment with the idea of writing a filtering function.

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