excludes and excludeSelected Attributes in Variables

In variables, use the excludes attribute in variables to define values to exclude from selections in response to wizard questions. Use the excludeSelected attribute to exclude values that have already been selected in previous wizard questions.

"excludes" Attribute 

Regex Token Definition: "/<regex pattern>/flags"

Flags are characters that Javascript RegEx global object takes, for example: g, i, m, u, and so on. Refer to the RegEx Object API documentation for details.

Example excludes statements:

  • "excludes" : ["Name", "/^(Billing).+/"]—Excludes Name field and all the fields that start with Billing.
  • "excludes" : ["/^(?!Billing)^(?!Shipping).+/"]—Excludes all fields except fields that start with Billing or Shipping.
  • "excludes" : ["/.+(_kav)$/"]—Excludes all fields that end with _kav.
  • "excludes" : ["/^(?:(?!_kav).)*$/"]—Excludes all fields except fields that end with _kav.
  • "excludes" : ["/(?!^Case$|^Account$)(^.*$)/"]—Excludes all objects except Case and Account.

Including a value in defaultValue that is excluded results in an error.

Note

excludeSelected Attribute 

In this example, the option selected in SObjectField1 picker isn’t available in SObjectField2 picker.

1"SObjectField1" : {
2  "label" : "Select a field from account",
3  "description" : "First account field.",
4  "defaultValue" : {
5    "sobjectName" : "Account",
6    "fieldName" : ""
7  },
8  "required" : true,
9  "excludeSelected" : true,
10  "variableType" : {
11    "type" : "SobjectFieldType"
12   }
13},
14"SObjectField2" : {
15  "label" : "Select another field from account",
16  "description" : "Second account field.",
17  "defaultValue" : {
18    "sobjectName" : "Account",
19    "fieldName" : ""
20  },
21  "required" : true,
22  "excludeSelected" : true,
23  "variableType" : {
24    "type" : "SObjectFieldtype"
25  }
26}