Actions in Acton Button

I would like to know the list of actions in the action button.
Even if I look here, I can only find AddRecord, UpdateRecord, and DeleteRecord.
What else is there?

Thanks in advance.

I think these are the different options:

  • AddRecord
  • BulkAddRecord
  • RemoveRecord
  • BulkRemoveRecord
  • UpdateRecord
  • BulkUpdateRecord
  • ReplaceTableData
  • TableDataAction
  • AddColumn
  • RemoveColumn
  • RenameColumn
  • ModifyColumn
  • AddTable
  • RemoveTable
  • RenameTable

See grist-core/app/common/DocActions.ts at 5f0c3bd8545256b4d3310ace197aace284ce8633 · gristlabs/grist-core · GitHub

I think in terms of backend system functionalities, Addrecord, UpdateRecord and DeleteRecord can do most stuff you will want to do.

I mean… that basically covers what a user does. He creates, updates or delete records.

This is one Action Button I created… in one widget I select a “Company Training”. In the other I have a list of employees and their respectives groups, functions, etc. So you can filter by employee, or by their functions.

And then you select the employees you want.

The action button updates to show the number of selected employees. You click the action button and it creates new records in a n-n table, with the training on one column and employee in the other column.

actions = []
existing_treinamentos_funcionarios = set(Func_x_Treinamento.lookupRecords(Treino=$id).Funcionario)
count = 0
for e in Funcionarios.all:
  if e not in existing_treinamentos_funcionarios and e.Selecao:
    actions.append(["AddRecord", "Func_x_Treinamento", None, {
      "Treino": $id,
      "Funcionario": e.id,
      "Presenca": None
    }])
    actions.append(["UpdateRecord", "Funcionarios", e.id, {"Selecao":False}])
    count += 1
if actions:
    return {
      "button": "Gerar {} Registros".format(count),
      "description": 'Gerar registros de Treinamento'.format(count, $Titulo),
      "actions": actions
    }
else:
    return {
      "button": "Zero Registros",
      "description": "Zero Registros",
      "actions": actions
    }