Skip to main content
Version: 4.9.0

CatalogUiPolicy

API reference and patterns for Catalog UI Policies (catalog_ui_policy) for catalog items and record producers and variable sets.

Signature

CatalogUiPolicy(config)

Parameters

config

CatalogUiPolicyProps

Catalog UI Policy configuration — condition, actions, target item or variable set.

Properties

  • $id (required): string | number | ExplicitKey<string>

  • shortDescription (required): string Description of what the policy does.

  • actions (optional): CatalogUiPolicyAction[] Actions to take when the policy is triggered.

  • active (optional): boolean Whether the policy is active. Default: true.

  • appliesOnCatalogItemView (optional): boolean Whether the policy applies when viewing the catalog item. Default: true.

  • appliesOnCatalogTasks (optional): boolean Whether the policy applies on catalog tasks. Default: false.

  • appliesOnRequestedItems (optional): boolean Whether the policy applies on requested items. Default: false.

  • appliesOnTargetRecord (optional): boolean Whether the policy applies on the target record. Default: false.

  • appliesTo (optional): 'item' | 'set' Required if using variableSet. Default: 'item'.

  • catalogCondition (optional): string Condition to determine when the policy applies to the catalog.

  • catalogItem (optional): string | CatalogItem Required if not using variableSet. Mutually exclusive with variableSet.

  • description (optional): string Detailed description of the UI policy.

  • executeIfFalse (optional): string Script to execute when the policy condition is false.

  • executeIfTrue (optional): string Script to execute when the policy condition is true.

  • global (optional): boolean Whether the policy applies globally. Default: true.

  • isolateScript (optional): boolean Whether to isolate the script execution context. Default: true.

  • onLoad (optional): boolean Whether the UI policy runs on page load. Default: true.

  • order (optional): number Order in which the policy should be evaluated.

  • protectionPolicy (optional): 'read' | 'protected' Controls edit/view access for other developers after the application is installed. 'read' lets others view but not modify; 'protected' prevents any changes. Omit to allow customization.

  • reverseIfFalse (optional): boolean Whether to reverse the policy condition logic. Default: true.

  • runScripts (optional): boolean Whether the UI policy runs scripts. Default: false.

  • runScriptsInUiType (optional): 'desktop' | 'mobileOrServicePortal' | 'all' Default: 'all'.

  • vaSupported (optional): boolean Whether the policy is supported for virtual agents. Default: true.

  • variableSet (optional): string | VariableSet Required if not using catalogItem. Mutually exclusive with catalogItem.

Action Properties

PropertyTypeDescription
variableNamestring | VariableReferenceRequired. Variable reference.
visiblebooleanShow/hide the variable.
mandatorybooleanMake variable required.
readOnlybooleanMake variable read-only.
clearedbooleanWhether the field should be cleared when the policy is triggered. Default: false.
valuestringValue to set.
valueActionstring'clearValue' or 'setValue'.
ordernumberExecution order. Default: 100.
variableMessagestringMessage to display on the field.
variableMessageTypestring'info', 'warning', 'error'.

Condition Syntax

// Simple condition
catalogCondition: `${catalogItem.variables.priority}=high^EQ`;

// Multiple conditions with AND
catalogCondition: `${catalogItem.variables.env}=prod^${catalogItem.variables.critical}=true^EQ`;

// Multiple conditions with OR
catalogCondition: `${catalogItem.variables.env}=prod^OR${catalogItem.variables.critical}=true^EQ`;

// Not empty check
catalogCondition: `${catalogItem.variables.reference}ISNOTEMPTY^EQ`;

Priority Rules

  1. Mandatory has highest priority
  2. If a variable is mandatory and has no value, readonly/hide actions do not work
  3. If a variable set/container has a mandatory variable without value, the entire set cannot be hidden
  4. "Clear value" action does not work on variable sets and containers

Variable Type Limitations

Policy TypeNot Applicable To
MandatoryFraction, Container Split, Container End, UI Macro, Label, UI Page
Read-onlyFraction, Container Split, Container End, UI Macro, Label, UI Page
VisibilityFraction, Container Split, Container End

When to Use UI Policy vs Client Script

Use CaseUI PolicyClient Script
Show/hide variablesPreferredSupported
Make variables mandatoryPreferredSupported
Make variables read-onlyPreferredSupported
Set variable valuesSupportedSupported
Complex validationLimitedPreferred
Dynamic calculationsLimitedPreferred
API calls / asyncNot supportedSupported
Form submission controlNot supportedSupported

Common User Requests Mapping

User RequestAgent Implementation
"Show field when priority is high"UI Policy with condition and visible action
"Make field read-only conditionally"UI Policy with readOnly and setValue actions
"Run script when condition matches"UI Policy with runScripts and executeIfTrue/False
"Apply policy to variable set"UI Policy with variableSet and appliesTo: "set"

Quick Reference

ALWAYS

  • Use UI Policies for simple show/hide/mandatory/read-only logic
  • Use object references in properties (e.g., catalogItem.variables.urgency)
  • End conditions with ^EQ
  • Use reverseIfFalse: true to auto-reverse when condition no longer matches

NEVER

  • Use UI Policies for complex validation (use Client Scripts)
  • Use UI Policies for async/API calls (use Client Scripts)
  • Hide mandatory variables that have no value (action will not work)