Metadata Components

This topic describes the list of available components that can be used on metadata-driven wizards.

Text 

PropertyTypeSupports Expression?Default ValueRequired?Description
idStringNo YesCase-sensitive unique identifier of the component instance. This identifier must be unique between all components in the wizard metadata configuration
typeStringNo YesValue is Text.
visibleBooleanYestrueNoDetermines 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.
editableBooleanYestrueNoDetermines if the value of the component can be edited.
activeBooleanYestrueNoDetermines if the values of the component are set as part of the wizard result.
labelStringYes<empty>NoDisplay label for the field.
requiredBooleanNofalseNoDetermines if the field is required. If the field is required and no value is provided, the user is unable to submit the wizard.
outputPropertyStringNo<empty>NoProperty of the result where the value of the input is set.
defaultValueStringYes<empty>NoDefault value of the component.
maxLengthNumberYesInfinityNoMaximum length the input can be. If exceeded, the input won’t be considered valid and the wizard can’t be submitted.
minLengthNumberYes-InfinityNoMinimum 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.
placeholderStringYes<empty>NoPlaceholder on the input field for when a value isn’t set.

Example

1{
2     id :  promoSlogan ,
3     type :  Text ,
4     outputProperty :  Slogan ,
5     required : true,
6     label :  Slogan ,
7     maxLength : 80,
8     defaultValue :  {! _input_.Slogan } 
9}

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.

PropertyTypeSupports ExpressionDefault ValueRequiredDescription
idStringNo YesCase-sensitive unique identifier of the component instance. This identifier must be unique between all components in the wizard metadata configuration
defaultValueStringYes<empty>NoDefault value of the component.
visibleBooleanYestrueNoDetermines if the component is rendered or not. Even if a component isn’t rendered, validations occur and the value is on the wizard result.
requiredBooleanNofalseNoDetermines 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.
editableBooleanYestrueNoDetermines if the value of the component can be edited.
activeBooleanYestrueNoDetermines if the value of the component is set as part of the wizard result.
labelStringYes<empty>NoDisplay label for the field.
autoAdjustBooleanNofalseNoIf 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.
decimalPlacesNumberYesInfinityNoMaximum amount of decimal places a value can have. If exceeded, the additional decimal places are truncated.
maxNumberYesInfinityNoMaximum 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.
minNumberYes-InfinityNoMinimum 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.
placeholderStringYes<empty>NoPlaceholder on the input field for when a value isn’t set.
outputPropertyStringNo<empty>NoProperty of the result where the value of the input is set.
typeStringNo YesValue is Number.

Example

1{
2     id :  promoPrice ,
3     type :  Number ,
4     outputProperty :  Price ,
5     required : true,
6     label :  Price ,
7     max : 1000000,
8     min : 0,
9     decimalPlaces : 2,
10     autoAdjust : true
11}

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.

Properties

PropertyTypeSupports ExpressionDefault ValueRequiredDescription
idStringNo YesCase-sensitive unique identifier of the component instance. This identifier must be unique between all components in the wizard metadata configuration
typeStringNo YesValue is Label
visibleBooleanYestrueNoDetermines 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.
colorStringNoblackNoColor of the text.
messageStringYes<empty>NoMessage to display on the label.

Example

1{
2     id :  myLabel ,
3     type :  Label ,
4     color :  red ,
5     visible : {
6         left :  {! promoTemplate.Name } ,
7         operator :  equal ,
8         right  :  Customer Promotion 
9    },
10     message :  Selected Customer Promotion! 
11}

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.

PropertyTypeSupports Expression?Default ValueRequired?Description
idStringNo YesCase-sensitive unique identifier of the component instance. This identifier must be unique between all components in the wizard metadata configuration
typeStringNo YesValue is Empty
visibleBooleanYestrueNoDetermines 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

1{
2     id :  myEmptyBlock ,
3     type :  Empty ,
4     visible : {
5         left :  {! promoTemplate.Name } ,
6         operator :  equal ,
7         right  :  Customer Promotion 
8    }
9}

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.

PropertyTypeSupports Expression?Default ValueRequired?Description
idStringNo YesCase-sensitive unique identifier of the component instance. This identifier must be unique between all components in the wizard metadata configuration
typeStringNo YesValue is Date
visibleBooleanYestrueNoDetermines 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.
editableBooleanYestrueNoDetermines if the value of the component can be edited.
activeBooleanYestrueNoDetermines if the value of the component is set as part of the wizard result.
labelStringYes<empty>NoDisplay label for the field.
requiredBooleanNofalseNoDetermines 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.
outputPropertyStringNo<empty>NoProperty of the result where the value of the input is set.
defaultValueStringYes<empty>NoDefault value of the component. The Date value must be provided as a String with format YYYY-MM-DD .

Example

1{
2     id :  promoDateFrom ,
3     type :  Date ,
4     outputProperty :  DateFrom ,
5     required : true,
6     label :  Date From ,
7     defaultValue :  2020-01-01 
8}

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.

PropertyTypeSupports ExpressionDefault ValueRequiredDescription
idStringNo YesCase-sensitive unique identifier of the component instance. This identifier must be unique between all components in the wizard metadata configuration
      
typeStringNo YesValue is Duration
visibleBooleanYestrueNoDetermines 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.
editableBooleanYestrueNoDetermines if the value of the component can be edited.
activeBooleanYestrueNoDetermines if the value of the component is set as part of the wizard result.
labelStringYes<empty>NoDisplay label for the field.
requiredBooleanNofalseNoDetermines 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.
outputPropertyStringNo<empty>NoProperty of the result where the value of the input will be set.
defaultValueObjectYes NoDefault values for the Number field and the Weeks/Months picklist of the component. Possible values: day, week, or month.
referenceDateStringYes YesInitial date to add the number of selected weeks/months to. Format: YYYY-MM-DD

Example defaultValue:

1{
2     metric :  week ,
3     quantity : 1
4}

Example

1{
2     id :  promoDuration ,
3     type :  Duration ,
4     outputProperty :  DateThru ,
5     required : true,
6     label :  Duration ,
7     referenceDate :  {! DateFrom } 
8}

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.

PropertyTypeSupports ExpressionDefault ValueRequiredDescription
idStringNo YesCase-sensitive unique identifier of the component instance. This identifier must be unique between all components in the wizard metadata configuration
typeStringNo YesValue is Checkbox
visibleBooleanYestrueNoDetermines 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.
editableBooleanYestrueNoDetermines if the value of the component can be edited.
activeBooleanYestrueNoDetermines if the value of the component is set as part of the wizard result.
labelStringYes<empty>NoDisplay label for the field.
outputPropertyStringNo<empty>NoProperty of the result where the value of the input is set.
defaultValueBooleanYesfalseNoDefault value of the component.

Example

1{
2     id :  promoCheckbox ,
3     type :  Checkbox ,
4     outputProperty :  myCheckbox ,
5     label :  Promotion Checkbox ,
6     defaultValue : true
7}

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.

PropertyTypeSupports Expression?Default ValueRequired?Description
idStringNo YesCase-sensitive unique identifier of the component instance. This identifier must be unique between all components in the wizard metadata configuration
typeStringNo YesValue is Picklist
visibleBooleanYestrueNoDetermines 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.
editableBooleanYestrueNoDetermines if the value of the component can be edited.
activeBooleanYestrueNoDetermines if the value of the component is set as part of the wizard result.
labelStringYes<empty>NoDisplay label for the field.
requiredBooleanNofalseNoDetermines 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.
outputPropertyStringNo<empty>NoProperty of the result where the value of the input will be set.
defaultValueString || List<String>Yes<empty>NoDefault value of the component.
autoSelectFirstItemBooleanNofalseNoIf 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.
defaultValueIndexNumberYes<empty>NoIf 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.
multiselectBooleanNofalseNoIf enabled, the user is able to select multiple items on the pick list instead of just a single one.
maxSelectedItemsNumberNoInfinityNoIf the pick list is multiselect, it defines the maximum number of items that can be selected. Selecting an additional item after the limit is reached will cause the first selected item to be unselected.
sourceList<Object> || ObjectNo YesRefer to the pick list source section for more information.
itemLabelFieldStringNoNameNoThe property name for each of the items in (or resolved by) the source that will be used as label on the pick list.
itemValueFieldStringNoIdNoThe 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.

It’s important to note that the object records that are part of the dataset for a picklist field can have as many properties as needed. These properties can be accessed through Expressions in other components, as seen on the examples.

Note

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:

1...
2 source : [
3    {
4         Id :  myFirstValue ,
5         Name :  My First Value ,
6         MyAdditionalField :  MyAdditionalFieldForFirstItem 
7    },
8    {
9         Id :  mySecondValue ,
10         Name :  My Second Value ,
11         MyAdditionalField :  MyAdditionalFieldForSecondItem 
12    }
13],
14 itemLabelField :  Name ,
15 itemValueField :  Id 
16...

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.

1...
2 source : {
3     class :  MyPicklistValues ,
4     method :  getPicklistValues ,
5     cache : true,
6     params : {
7         myFirstParameter :  firstParameterValue ,
8         mySecondParameter :  {! promoTemplate.Id } 
9    }
10},
11 itemLabelField :  Name ,
12 itemValueField :  Id 
13...
PropertyTypeDefault ValueRequired?Description
classString YesThe name of the APEX Callable class.
methodString<empty>NoAn 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.
cacheBooleanfalseNoIf 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.
paramsObject{}NoIt’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.

When using expressions on the params property, the same rules as with other WizardComponents apply. Whenever a referenced component changes, the request to the APEX callable class will be executed again. It’s highly advisable to enable caching ( cache : true) on the source in order to not execute duplicated calls against Salesforce servers and greatly improve performance.

Note

Example Callable Class

1public with sharing class MyPicklistValues implements System.Callable {
2    public class MyPicklistValuesException extends Exception {};
3  
4    public Object call(String method, Map<String, Object> params) {
5          
6        // Check that the provided method is the expected method
7        // It is possible to have multiple methods in the same class
8        if (method !== 'getPicklistValues') {
9            throw new MyPicklistValuesException('Invalid Method!');
10        }
11 
12        // we can extract call parameters from the  params  property
13        String myFirstParameter = (String) params.get('myFirstParameter');
14        String mySecondParameter = (String) params.get('mySecondParameter');
15  
16        return new List<Map<String, String>> {
17            new Map<String, String> {
18                'Id' => 'myFirstValue',
19                'Name' => 'My First Value',
20                'MyAdditionalField' => 'MyAdditionalFieldForFirstItem'
21            },
22            new Map<String, String> {
23                'Id' => 'mySecondValue',
24                'Name' => 'My Second Value',
25                'MyAdditionalField' => 'MyAdditionalFieldForSecondItem'
26            }
27        };
28    }
29  
30}

Example

1{
2     id :  promoExamplePicklist ,
3     type :  Picklist ,
4     required : true,
5     outputProperty :  ExamplePicklist ,
6     source : {
7         class :  MyPicklistValues ,
8         method :  getPicklistValues ,
9         cache : true,
10         params : {
11             myFirstParameter :  firstParameterValue ,
12             mySecondParameter :  {! promoTemplate.Id } 
13        }
14    },    
15     label :  ExamplePicklist ,
16     autoSelectFirstItem : true
17}

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:

1// if the first item is selected (Id =  myFirstValue )
2{
3     Id :  myFirstValue ,
4     Name :  My First Value ,
5     MyAdditionalField :  MyAdditionalFieldForFirstItem 
6}
7 
8// if the second item is selected
9{
10     Id :  mySecondValue ,
11     Name :  My Second Value ,
12     MyAdditionalField :  MyAdditionalFieldForSecondItem 
13}

Since the picklist exposes an object as an expression value, Properties of these dataset records can be used on expressions using dot notation:

1{! promoExamplePicklist.MyAdditionalField }  --> resolves to  MyAdditionalFieldForFirstItem 
2 {! 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.

1// if the first item is selected (Id =  myFirstValue )
2[
3    {
4         Id :  myFirstValue ,
5         Name :  My First Value ,
6         MyAdditionalField :  MyAdditionalFieldForFirstItem 
7    }
8]
9 
10// if both the first item and second items are selected
11[
12    {
13         Id :  myFirstValue ,
14         Name :  My First Value ,
15         MyAdditionalField :  MyAdditionalFieldForFirstItem 
16    },
17    {
18         Id :  mySecondValue ,
19         Name :  My Second Value ,
20         MyAdditionalField :  MyAdditionalFieldForSecondItem 
21    }
22]

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:

1{! promoExamplePicklist[0].MyAdditionalField }  --> resolves to  MyAdditionalFieldForFirstItem 
2 {! promoExamplePicklist[1].MyAdditionalField }  --> resolves to  MyAdditionalFieldForSecondItem 
3 
4 {! promoExamplePicklist[99].MyAdditionalField }  --> resolves to undefined, since the element does not exist.

Result Value

single select

1// if the first item is selected (Id =  myFirstValue )
2{
3     ExamplePicklist :  myFirstValue        // since  itemValueField  is  Id , we set the  Id  property of the selected record
4}
5 
6// if the first item is selected (Id =  mySecondValue )
7{
8     ExamplePicklist :  mySecondValue       // since  itemValueField  is  Id , we set the  Id  property of the selected record
9}

multiselect

1// if the first item is selected (Id =  myFirstValue )
2{
3     ExamplePicklist : [ myFirstValue ]     // since  itemValueField  is  Id , we set the  Id  property of the selected record
4}
5 
6// if the bot items are selected
7{
8     ExamplePicklist : [ myFirstValue ,  mySecondValue ]        // since  itemValueField  is  Id , we set the  Id  property of the selected record
9}

ListController 

This component displays a control that allows users to add items to an Array. For each one of the items, the parameter list of WizardComponent metadata is replicated in order to provide components to handle each item of the list.

PropertyTypeSupports ExpressionsDefault ValueRequiredDescription
activeBooleanYestrueNoDetermines if the value of the component is set as part of the wizard result.
columnsNumberNo3NoDefines the number of columns that each item in the list has as layout.
componentsList<WizardComponent>No[ ]NoThe metadata of the components that will be replicated for each item in the list.
defaultItemsNumberYes0NoWhen first rendering the control, the number of items that will be created by default.
editableBooleanYestrueNoDetermines if the value of the component can be edited.
idStringNo YesCase-sensitive unique identifier of the component instance. This identifier must be unique between all components in the wizard metadata configuration
itemUniqueKeyStringYes<empty>NoWhen 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.
labelStringYes<empty>NoDisplay label for the field.
maxItemsNumberYesInfinityNoThe maximum number of items the control can have.
outputPropertyStringNo<empty>NoProperty of the result where the value of the input will be set.
typeStringNo YesValue is Checkbox
visibleBooleanYestrueNoDetermines 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

1{
2   id :  TacticController ,
3   type :  ListController ,
4   label :  Tactics ,
5   outputProperty :  Tactics ,
6   maxItems : 10,
7   active :  {! promoTemplate.HasTacticTemplates } ,
8   defaultItems : 2,
9   components : [
10    {
11       id :  tacticTemplate ,
12       type :  Picklist ,
13       required : true,
14       outputProperty :  TacticTemplate ,
15       source : {
16         class :  NewPromotionWizardCallable ,
17         method :  getTacticTemplates ,
18         params : {
19           promoTemplate :  {! promoTemplate.Id } 
20        },
21         cache : true
22      },
23       label :  Tactic Template ,
24       defaultValueIndex :  {! _idx_ } ,
25       autoSelectFirstItem : true
26    }
27  ]
28}

Expression Value

Metadata configuration example

1components : [
2    {
3         id :  promoSlogan ,                // A wizard component for the promotion slogan input
4         type :  Text ,
5         label :  Slogan 
6    },
7    {
8         id :  promoSampleText ,            // A wizard component for a text
9         type :  Text ,
10         label :  SampleText 
11    },
12    {
13         id :  TacticController ,           // A wizard component for the Tactics list
14         type :  ListController ,
15         label  :  Tactics ,
16         components : [                     // This List of wizard components will create a new scope for the items below!
17            {
18                 id :  tacticName ,
19                 type :  Text ,                     // For each tactic, we will have a name field
20                 label :  MyTacticName 
21            },
22            {
23                 id :  tacticSampleText ,
24                 type :  Text ,                     // For each tactic, we will have a text field
25                 label :  MyTacticSampleText 
26            }
27        ]
28    }
29]

Expression scope

1// Context for expressions on the  promoSlogan  component
2{
3     promoSlogan :  slogan value ,                  // provided by itself
4     promoSampleText :  sample text                 // provided by the  promoSampleText  component in the same level
5}
6  
7// Context for expressions on the  tacticName  component
8{
9     promoSlogan :  slogan value ,                  // provided by  promoSlogan , accessible since it's above in the hierarchy
10     promoSampleText :  sample text ,               // provided by  promoSampleText , accessible since it's above in the hierarchy
11     _idx_ : 1,                                     // provided by the ListController component, Item index on the array
12     tacticName :  tactic 1's name ,                // provided by itself
13     tacticSampleText :  tactic 1's sample text     // provided by the  tacticSampleText  component in the same level
14}

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.