pagehive

update_action

Update a visitor action.

Visitor actionsChanges dataAll plansUpdated

What it does

Update a visitor action. Send the fields that change. Changing kind starts the spec over from the fields you send. An action that is already public can be edited when can_public_actions is off, so access can move away from public. Setting access to public needs the right.

Plans

Works on every plan: Free, Basic, Pro and Ultra.

Parameters

NameTypeAbout
site_idrequiredstringThe id of the site. list_sites gives the ids of your sites.
namerequiredstringThe action to change.
tablestringA different table for the action.
kindone of: toggle, set, fixed, edit, add, deleteA new kind: toggle, set, fixed, edit, add or delete.
accessone of: off, owner, share, share_review, public, member_own, member_allWho may run it: off, owner, share, share_review, public, member_own or member_all.
columnstring or nullThe column a toggle or set action writes.
allowedarray of stringFor set: the values a visitor may choose.
whenobjectFor set: other columns to write for each chosen value.
setobjectFixed column values written every time the action runs.
paramsarray of objectsFor fixed: bounded numbers a visitor chooses, each with name, min, max and column.
fieldsarray of string or objectFor edit and add: the columns a visitor may write.
honeypotstring or nulladd only: the name of a hidden form field that is not a column. A submission that fills it in is answered as usual but not saved. null removes it.
on_copyone of: off, keepSite templates: keep makes a copy start this action on with access owner. Only owner actions may be published with keep; public and share actions always start off in a copy. Default off.

Example

Call update_action with these arguments:

{
  "site_id": "01a1…",
  "name": "toggle_done",
  "access": "member_all"
}

Ids like 01a1… stand for your own. list_sites and list_tables give you the real ones.

Related guides