Metadata Components
Text
Property | Type | Supports Expression? | Default Value | Required? | Description |
---|---|---|---|---|---|
id | String | No | Yes | Case-sensitive unique identifier of the component instance. This identifier must be unique between all components in the wizard metadata configuration | |
type | String | No | Yes | Value is Text. | |
visible | Boolean | Yes | true | No | Determines whether the component is rendered or not. Even if a component isn’t rendered, validations occur and the value are set on the wizard result. |
editable | Boolean | Yes | true | No | Determines if the value of the component can be edited. |
active | Boolean | Yes | true | No | Determines if the values of the component are set as part of the wizard result. |
label | String | Yes | <empty> | No | Display label for the field. |
required | Boolean | No | false | No | Determines if the field is required. If the field is required and no value is provided, the user is unable to submit the wizard. |
outputProperty | String | No | <empty> | No | Property of the result where the value of the input is set. |
defaultValue | String | Yes | <empty> | No | Default value of the component. |
maxLength | Number | Yes | Infinity | No | Maximum length the input can be. If exceeded, the input won’t be considered valid and the wizard can’t be submitted. |
minLength | Number | Yes | -Infinity | No | Minimum length the input can be. If the length of the input is less than the minimum length, the input isn’t valid and the wizard can’t be submitted. |
placeholder | String | Yes | <empty> | No | Placeholder on the input field for when a value isn’t set. |
- Example
{
id : promoSlogan ,
type : Text ,
outputProperty : Slogan ,
required : true,
label : Slogan ,
maxLength : 80,
defaultValue : {! _input_.Slogan }
}
- Expression Value
- When referenced on an expression, this component returns the current text value of the input.
- Result Value
-
When generating the result, this component sets the value of the text input on the property defined by the outputProperty attribute in the result object. If outputProperty isn’t set or the active property resolves to false, no data is set on the output object.
Number
This component displays a numeric field.
Property | Type | Supports Expression | Default Value | Required | Description |
id | String | No | Yes | Case-sensitive unique identifier of the component instance. This identifier must be unique between all components in the wizard metadata configuration | |
defaultValue | String | Yes | <empty> | No | Default value of the component. |
visible | Boolean | Yes | true | No | Determines if the component is rendered or not. Even if a component isn’t rendered, validations occur and the value is on the wizard result. |
required | Boolean | No | false | No | Determines if the field is required. If the field is required and no value is provided, the user will not be able to submit the wizard. |
editable | Boolean | Yes | true | No | Determines if the value of the component can be edited. |
active | Boolean | Yes | true | No | Determines if the value of the component is set as part of the wizard result. |
label | String | Yes | <empty> | No | Display label for the field. |
autoAdjust | Boolean | No | false | No | If enabled, after a user sets a value in the input, the value will be adjusted to the boundaries defined by the max and min properties in order for the input to be valid. If disabled, the wrong input is notified to the user as an invalid input. |
decimalPlaces | Number | Yes | Infinity | No | Maximum amount of decimal places a value can have. If exceeded, the additional decimal places are truncated. |
max | Number | Yes | Infinity | No | Maximum value the input can be. If the value of the input exceeds the maximum value, the input will not be considered valid and the wizard can’t be submitted. |
min | Number | Yes | -Infinity | No | Minimum value the input can be. If the value of the input is less than the minimum, the input will not be considered valid and the wizard can’t be submitted. |
placeholder | String | Yes | <empty> | No | Placeholder on the input field for when a value isn’t set. |
outputProperty | String | No | <empty> | No | Property of the result where the value of the input is set. |
type | String | No | Yes | Value is Number. |
- Example
{
id : promoPrice ,
type : Number ,
outputProperty : Price ,
required : true,
label : Price ,
max : 1000000,
min : 0,
decimalPlaces : 2,
autoAdjust : true
}
- Expression Value
-
When referenced on an Expression, this component returns the current numeric value of the input.
- Result Value
-
When generating the result, this component sets the value of the numeric input on the property defined by the outputProperty attribute in the result object. If outputProperty isn’t set or the active property resolves to false, no data is set on the output object.
Label
This component displays a non-editable text.
Property | Type | Supports Expression | Default Value | Required | Description |
---|---|---|---|---|---|
id | String | No | Yes | Case-sensitive unique identifier of the component instance. This identifier must be unique between all components in the wizard metadata configuration | |
type | String | No | Yes | Value is Label | |
visible | Boolean | Yes | true | No | Determines if the component is rendered or not. Even if a component isn’t rendered, validations still occur and the value is set on the wizard result. |
color | String | No | black | No | Color of the text. |
message | String | Yes | <empty> | No | Message to display on the label. |
- Example
{
id : myLabel ,
type : Label ,
color : red ,
visible : {
left : {! promoTemplate.Name } ,
operator : equal ,
right : Customer Promotion
},
message : Selected Customer Promotion!
}
- Expression Value
-
When referenced on an Expression, this component returns an empty value.
- Result Value
-
This component doesn’t push any value to the result structure.
Empty
This component doesn’t display any input. It takes the space any other input would take.
Property | Type | Supports Expression? | Default Value | Required? | Description |
---|---|---|---|---|---|
id | String | No | Yes | Case-sensitive unique identifier of the component instance. This identifier must be unique between all components in the wizard metadata configuration | |
type | String | No | Yes | Value is Empty | |
visible | Boolean | Yes | true | No | Determines if the component is rendered or not. Even if a component isn’t rendered, validations still occur and the value is set on the wizard result. |
- Example
{
id : myEmptyBlock ,
type : Empty ,
visible : {
left : {! promoTemplate.Name } ,
operator : equal ,
right : Customer Promotion
}
}
- Expression Value
-
When referenced on an Expression, this component returns an empty value.
- Result Value
-
This component doesn’t push any value to the result structure.
Date
This component displays a Date Picker field. The Date Picker date value is displayed according to the user's locale.
Property | Type | Supports Expression? | Default Value | Required? | Description |
---|---|---|---|---|---|
id | String | No | Yes | Case-sensitive unique identifier of the component instance. This identifier must be unique between all components in the wizard metadata configuration | |
type | String | No | Yes | Value is Date | |
visible | Boolean | Yes | true | No | Determines if the component is rendered or not. Even if a component isn’t rendered, validations still take place and the value is set on the wizard result. |
editable | Boolean | Yes | true | No | Determines if the value of the component can be edited. |
active | Boolean | Yes | true | No | Determines if the value of the component is set as part of the wizard result. |
label | String | Yes | <empty> | No | Display label for the field. |
required | Boolean | No | false | No | Determines if the field is required. If the field is required and no value is provided, the user won't be able to submit the wizard. |
outputProperty | String | No | <empty> | No | Property of the result where the value of the input is set. |
defaultValue | String | Yes | <empty> | No | Default value of the component. The Date value must be provided as a String with format YYYY-MM-DD . |
- Example
{
id : promoDateFrom ,
type : Date ,
outputProperty : DateFrom ,
required : true,
label : Date From ,
defaultValue : 2020-01-01
}
- Expression Value
-
When referenced on an Expression, this component returns the current date of the control as a string with the format YYYY-MM-DD .
- Result Value
-
When generating the result, this component sets the value of the date input on the property defined by the outputProperty attribute in the result object. If outputProperty isn’t set or the active property resolves to false, no data is set on the output object. The result data is set as a String with the format YYYY-MM-DD .
Duration
This component displays a control with 2 inputs. A numeric field and a picklist field. On the numeric field, the user can input a number. On the picklist field, the user can select Days, Weeks, or Months. This control is used to calculate a second date based on another reference date by adding a number of weeks or months to it.
Property | Type | Supports Expression | Default Value | Required | Description |
id | String | No | Yes | Case-sensitive unique identifier of the component instance. This identifier must be unique between all components in the wizard metadata configuration | |
type | String | No | Yes | Value is Duration | |
visible | Boolean | Yes | true | No | Determines if the component is rendered or not. Even if a component isn’t rendered, validations still occur and the value is set on the wizard result. |
editable | Boolean | Yes | true | No | Determines if the value of the component can be edited. |
active | Boolean | Yes | true | No | Determines if the value of the component is set as part of the wizard result. |
label | String | Yes | <empty> | No | Display label for the field. |
required | Boolean | No | false | No | Determines if the field is required. If the field is required and no value is provided, the user won't be able to submit the wizard. |
outputProperty | String | No | <empty> | No | Property of the result where the value of the input will be set. |
defaultValue | Object | Yes |
|
No |
Default values for the Number field and the Weeks/Months picklist of the component. Possible values:
|
referenceDate | String | Yes | Yes | Initial date to add the number of selected weeks/months to. Format: YYYY-MM-DD |
- Example
{
id : promoDuration ,
type : Duration ,
outputProperty : DateThru ,
required : true,
label : Duration ,
referenceDate : {! DateFrom }
}
- Expression Value
-
When referenced on an Expression, this component returns the computed date of the control as a string with the format YYYY-MM-DD .
- Result Value
-
When generating the result, this component sets the value of the computed date on the property defined by the outputProperty attribute in the result object. If outputProperty isn’t set or the active property resolves to false, no data is set on the output object. The result data is set as a String with the format YYYY-MM-DD .
Checkbox
This component displays a checkbox field.
Property | Type | Supports Expression | Default Value | Required | Description |
---|---|---|---|---|---|
id | String | No | Yes | Case-sensitive unique identifier of the component instance. This identifier must be unique between all components in the wizard metadata configuration | |
type | String | No | Yes | Value is Checkbox | |
visible | Boolean | Yes | true | No | Determines if the component is rendered or not. Even if a component isn’t rendered, validations still occur and the value is set on the wizard result. |
editable | Boolean | Yes | true | No | Determines if the value of the component can be edited. |
active | Boolean | Yes | true | No | Determines if the value of the component is set as part of the wizard result. |
label | String | Yes | <empty> | No | Display label for the field. |
outputProperty | String | No | <empty> | No | Property of the result where the value of the input is set. |
defaultValue | Boolean | Yes | false | No | Default value of the component. |
- Example
{
id : promoCheckbox ,
type : Checkbox ,
outputProperty : myCheckbox ,
label : Promotion Checkbox ,
defaultValue : true
}
- Expression Value
-
When referenced on an Expression, this component returns the current value of the control as a Boolean.
- Result Value
-
When generating the result, this component sets the value of the control on the property defined by the outputProperty attribute in the result object. If outputProperty isn’t set or the active property resolves to false, no data is set on the output object. The result data is set as a Boolean.
Picklist
This component displays a picklist field.
Property | Type | Supports Expression? | Default Value | Required? | Description |
---|---|---|---|---|---|
id | String | No | Yes | Case-sensitive unique identifier of the component instance. This identifier must be unique between all components in the wizard metadata configuration | |
type | String | No | Yes | Value is Picklist | |
visible | Boolean | Yes | true | No | Determines if the component is rendered or not. Even if a component isn’t rendered, validations still occur and the value is set on the wizard result. |
editable | Boolean | Yes | true | No | Determines if the value of the component can be edited. |
active | Boolean | Yes | true | No | Determines if the value of the component is set as part of the wizard result. |
label | String | Yes | <empty> | No | Display label for the field. |
required | Boolean | No | false | No | Determines if the field is required. If the field is required and no value is provided, the user won't be able to submit the wizard. |
outputProperty | String | No | <empty> | No | Property of the result where the value of the input will be set. |
defaultValue | String || List<String> | Yes | <empty> | No | Default value of the component. |
autoSelectFirstItem | Boolean | No | false | No | If set, when rendering the pick list, if no valid value is on the pick list, the system automatically selects the first item on the dataset as value. |
defaultValueIndex | Number | Yes | <empty> | No |
If set, when rendering the pick list, if no valid value is on the pick list, the system selects the item with the specified index from the dataset as value. |
multiselect | Boolean | No | false | No | If enabled, the user is able to select multiple items on the pick list instead of just a single one. |
maxSelectedItems | Number | No | Infinity | No | If the pick list is multiselect, it defines the maximum number of items that can be selected. |
source | List<Object> || Object | No | Yes | Refer to the pick list source section for more information. | |
itemLabelField | String | No | Name | No | The property name for each of the items in (or resolved by) the source that will be used as label on the pick list. |
itemValueField | String | No | Id | No | The property name for each of the items in (or resolved by) the source that will be used as value on the pick list. |
- Picklist Source
-
The list of available values for the picklist can be defined in 2 different ways.
- Static List of Values
-
In order to define a static list of values for a picklist, set the source property to be a list of objects. Each record on this list represents a possible value for the picklist:
...
source : [
{
Id : myFirstValue ,
Name : My First Value ,
MyAdditionalField : MyAdditionalFieldForFirstItem
},
{
Id : mySecondValue ,
Name : My Second Value ,
MyAdditionalField : MyAdditionalFieldForSecondItem
}
],
itemLabelField : Name ,
itemValueField : Id
...
- APEX Provided List of Values
-
You can retrieve the list of possible values for a picklist. The APEX callable classes are called to retrieve the values. In the WizardComponentmetadata, specify from which APEX callable class and method we want to get the values from.
... source : { class : MyPicklistValues , method : getPicklistValues , cache : true, params : { myFirstParameter : firstParameterValue , mySecondParameter : {! promoTemplate.Id } } }, itemLabelField : Name , itemValueField : Id ...
Property | Type | Default Value | Required? | Description |
---|---|---|---|---|
class | String | Yes | The name of the APEX Callable class. | |
method | String | <empty> | No | An optional Method name to pass to the callable class. The method can be used to have a single APEX Callable class be able to return different datasets depending on the specified method. |
cache | Boolean | false | No | If set, the response for a Callable APEX class will be cached in the browser. This implies that requests to the same APEX Callable class, to the same method and with the same parameters, will only be performed one time, and subsequent calls reuse the values from previous executions. |
params | Object | {} | No |
It's possible to pass additional parameters to the APEX Callable class using the params property. When calling the APEX class, the params object is passed to the APEX class as part of the request. The params object supports expressions as the value for their properties. These expressions values are resolved before calling the APEX callable class. |
- Example Callable Class
-
public with sharing class MyPicklistValues implements System.Callable { public class MyPicklistValuesException extends Exception {}; public Object call(String method, Map<String, Object> params) { // Check that the provided method is the expected method // It is possible to have multiple methods in the same class if (method !== 'getPicklistValues') { throw new MyPicklistValuesException('Invalid Method!'); } // we can extract call parameters from the params property String myFirstParameter = (String) params.get('myFirstParameter'); String mySecondParameter = (String) params.get('mySecondParameter'); return new List<Map<String, String>> { new Map<String, String> { 'Id' => 'myFirstValue', 'Name' => 'My First Value', 'MyAdditionalField' => 'MyAdditionalFieldForFirstItem' }, new Map<String, String> { 'Id' => 'mySecondValue', 'Name' => 'My Second Value', 'MyAdditionalField' => 'MyAdditionalFieldForSecondItem' } }; } }
-
- Example
{ id : promoExamplePicklist , type : Picklist , required : true, outputProperty : ExamplePicklist , source : { class : MyPicklistValues , method : getPicklistValues , cache : true, params : { myFirstParameter : firstParameterValue , mySecondParameter : {! promoTemplate.Id } } }, label : ExamplePicklist , autoSelectFirstItem : true }
-
- Expression Value
-
Depending if the field is multiselect or single select, the value that is accessible from expressions is different:
singles elect
When referenced on an Expression, this component returns the current dataset object that is selected on the picklist. For example, taking into account the above examples:
// if the first item is selected (Id = myFirstValue ) { Id : myFirstValue , Name : My First Value , MyAdditionalField : MyAdditionalFieldForFirstItem } // if the second item is selected { Id : mySecondValue , Name : My Second Value , MyAdditionalField : MyAdditionalFieldForSecondItem }
-
Since the picklist exposes an object as an expression value, Properties of these dataset records can be used on expressions using dot notation:
{! promoExamplePicklist.MyAdditionalField } --> resolves to MyAdditionalFieldForFirstItem {! promoExamplePicklist.MyNonExistantField } --> resolves to undefined, since the field doesn't exist
multiselect
When referenced on an Expression, this component returns the list of current dataset objects that are selected on the picklist.
// if the first item is selected (Id = myFirstValue ) [ { Id : myFirstValue , Name : My First Value , MyAdditionalField : MyAdditionalFieldForFirstItem } ] // if both the first item and second items are selected [ { Id : myFirstValue , Name : My First Value , MyAdditionalField : MyAdditionalFieldForFirstItem }, { Id : mySecondValue , Name : My Second Value , MyAdditionalField : MyAdditionalFieldForSecondItem } ]
-
Since the picklist exposes an array as an expression value, items on the array can be accessed using square bracket notation [0] . Also, Properties of these dataset records can be used on expressions using dot notation:
{! promoExamplePicklist[0].MyAdditionalField } --> resolves to MyAdditionalFieldForFirstItem
{! promoExamplePicklist[1].MyAdditionalField } --> resolves to MyAdditionalFieldForSecondItem
{! promoExamplePicklist[99].MyAdditionalField } --> resolves to undefined, since the element does not exist.
- Result Value
-
single select
// if the first item is selected (Id = myFirstValue ) { ExamplePicklist : myFirstValue // since itemValueField is Id , we set the Id property of the selected record } // if the first item is selected (Id = mySecondValue ) { ExamplePicklist : mySecondValue // since itemValueField is Id , we set the Id property of the selected record }
-
multiselect
// if the first item is selected (Id = myFirstValue ) { ExamplePicklist : [ myFirstValue ] // since itemValueField is Id , we set the Id property of the selected record } // if the bot items are selected { ExamplePicklist : [ myFirstValue , mySecondValue ] // since itemValueField is Id , we set the Id property of the selected record }
ListController
Property | Type | Supports Expressions | Default Value | Required | Description |
---|---|---|---|---|---|
active | Boolean | Yes | true | No | Determines if the value of the component is set as part of the wizard result. |
columns | Number | No | 3 | No | Defines the number of columns that each item in the list has as layout. |
components | List<WizardComponent> | No | [ ] | No | The metadata of the components that will be replicated for each item in the list. |
defaultItems | Number | Yes | 0 | No | When first rendering the control, the number of items that will be created by default. |
editable | Boolean | Yes | true | No | Determines if the value of the component can be edited. |
id | String | No | Yes | Case-sensitive unique identifier of the component instance. This identifier must be unique between all components in the wizard metadata configuration | |
itemUniqueKey | String | Yes | <empty> | No | When defined, the component evaluates the passed expression for each one of the items on the list. If it finds any duplicate values on the results of evaluating it, it shows an error message telling the user there are duplicate items and won't allow for the wizard to be submitted. |
label | String | Yes | <empty> | No | Display label for the field. |
maxItems | Number | Yes | Infinity | No | The maximum number of items the control can have. |
outputProperty | String | No | <empty> | No | Property of the result where the value of the input will be set. |
type | String | No | Yes | Value is Checkbox | |
visible | Boolean | Yes | true | No | Determines if the component is rendered or not. Even if a component isn’t rendered, validations still occur and the value is set on the wizard result. |
- Example
{
id : TacticController ,
type : ListController ,
label : Tactics ,
outputProperty : Tactics ,
maxItems : 10,
active : {! promoTemplate.HasTacticTemplates } ,
defaultItems : 2,
components : [
{
id : tacticTemplate ,
type : Picklist ,
required : true,
outputProperty : TacticTemplate ,
source : {
class : NewPromotionWizardCallable ,
method : getTacticTemplates ,
params : {
promoTemplate : {! promoTemplate.Id }
},
cache : true
},
label : Tactic Template ,
defaultValueIndex : {! _idx_ } ,
autoSelectFirstItem : true
}
]
}
- Expression Value
- Metadata configuration example
components : [ { id : promoSlogan , // A wizard component for the promotion slogan input type : Text , label : Slogan }, { id : promoSampleText , // A wizard component for a text type : Text , label : SampleText }, { id : TacticController , // A wizard component for the Tactics list type : ListController , label : Tactics , components : [ // This List of wizard components will create a new scope for the items below! { id : tacticName , type : Text , // For each tactic, we will have a name field label : MyTacticName }, { id : tacticSampleText , type : Text , // For each tactic, we will have a text field label : MyTacticSampleText } ] } ]
- Expression
scope
// Context for expressions on the promoSlogan component { promoSlogan : slogan value , // provided by itself promoSampleText : sample text // provided by the promoSampleText component in the same level } // Context for expressions on the tacticName component { promoSlogan : slogan value , // provided by promoSlogan , accessible since it's above in the hierarchy promoSampleText : sample text , // provided by promoSampleText , accessible since it's above in the hierarchy _idx_ : 1, // provided by the ListController component, Item index on the array tacticName : tactic 1's name , // provided by itself tacticSampleText : tactic 1's sample text // provided by the tacticSampleText component in the same level }
- Result Value
-
When generating the result, this component sets the array of generated items on the property defined by the outputProperty attribute in the result object. If outputProperty isn’t set or the active property resolves to false, no data is set on the output object.