Action Button Info

Apologies, it is indeed utterly undocumented. It exists as a workaround; hopefully we’ll have a better solution before long. The Action Button needs access to a column, with a formula that returns a value of this form:

{
    "description": "Some description text",
    "button": "Text of the button itself",
    "actions": [ACTIONS_TO_APPLY],
}

The actions field is a list of actions, having this form (for the most common kinds):

[
  ["AddRecord", "TableId", None, {"Col1": Value1, "Col2": Value2, ...}],
  ["UpdateRecord", "TableId", rowId, {"Col1": Value1, "Col2": Value2, ...}],
  ["RemoveRecord", "TableId", rowId],
]

The "actions" field should be a list of actions, and each action itself has the form of a list. So a single AddRecord action would look like [['AddRecord', 'MyTable', None, {"ColA": "ValueA"}]] (with two pairs of brackets).

There is an example of an Action Button to duplicate rows here: https://public.getgrist.com/ubYNJ1PPN9Vn/Action-Button/m/fork; it was used for a recent webinar.

2 Likes