Portal Community

visibilityRule — Show or Hide

The visibilityRule expression is evaluated reactively as form values change. When the expression returns false, the button is hidden entirely (not just greyed out). When it returns true, the button is visible.

// Show "Approve" button only when status field is "pending"
{
  "type": "custom",
  "label": "Approve",
  "variant": "primary",
  "visibilityRule": "values['approval-status'] === 'pending'"
}

// Show "Delete" only in admin mode
{
  "type": "custom",
  "label": "Delete Record",
  "variant": "danger",
  "modeVisibility": {
    "edit": false,
    "admin": true
  }
}

disabledRule — Enable or Disable

The disabledRule expression controls whether the button is clickable. When true, the button renders in a greyed-out, non-interactive state. Unlike visibilityRule, the button remains visible — users can see it but cannot click it.

// Disable submit until required agreement is checked
{
  "type": "submit",
  "label": "Submit Application",
  "variant": "primary",
  "disabledRule": "!values['terms-accepted'] || !values['privacy-accepted']"
}

// Disable link action when no row selected
{
  "type": "link",
  "label": "Edit Selected",
  "disabledRule": "!values['selected-row-id']"
}

Mode Visibility

Use modeVisibility to show/hide buttons based on the form's operating mode:

{
  "type": "submit",
  "label": "Save",
  "modeVisibility": {
    "edit": true,
    "view": false,    // Hide in view mode
    "admin": true,
    "preview": false  // Hide in preview
  }
}

Combining Rules

A button must pass ALL active rules to be shown and enabled:

Expression Context

Expressions have access to:

VariableTypeDescription
valuesobjectCurrent form field values keyed by field ID
modestringCurrent operating mode (edit, view, admin, etc.)
isDirtybooleanWhether the form has unsaved changes
isValidbooleanWhether all validation rules pass
isSubmittingbooleanWhether a submission is in progress