Get Started with Consumer Goods Cloud
Derive and Copy Promotions with MetadataWizard and Business Object API
Metadata Definition
Metadata Wizard Expression
Metadata Components
Promotion Wizard Input Structure
API End-of-Life Policy
Previous Versions
Expressions provide dynamic values to Wizard Components. Wizard Components accept expressions in some of their metadata properties. With expressions, you can also access instance values of other Wizard Components and dynamically set the metadata attributes, and create conditions. When a Wizard Component has an expression as a metadata attribute, the Wizard Component gets re-rendered every time the expression value changes.
An expression that doesn’t match the structure of the other expression types.
Example
1"{! !(promoTemplate.Name == 'Test' || promoTemplate.Name != 'Test2') }"
2...Access the properties of identifiers using the dot notation:
1"{! promoTemplate.Name }"| Literal | Example | Resolves to |
true | "{! true }" | Boolean true |
false | "{! false }" | Boolean false |
null | "{! null }" | null |
A string with a specific start and end sequence of characters (”{!” and ”}”).
Use these expressions to retrieve values from other Wizard Component instances by specifying the component ID of the Wizard Component instance.
Example
1...
2{
3 "id": "myCheckboxField",
4 "type": "Checkbox",
5},
6...
7{
8 "id": "myOtherField",
9 "active": "{! myCheckboxField }",
10...An object with these three properties - left, right, and operator.
Use this expression to perform operations between different values.
Example
1{
2 "left": <expression>
3 "operator": "equal",
4 "right" : <expression>
5}
6
7// Example
8...
9"active" : {
10 "left": "{! myCheckbox}",
11 "operator":"equal",
12 "right": true
13},
14...List of available operators:
andorequalnotEqualgreaterThanlessThangreaterThanOrEquallessThanOrEqualsumsubtractmultiplydivideAdditional values can also be referenced from expressions:
_input_ → The input payload passed to the Wizard instance during its creation. Use this variable to set default values:
"{! _input_.Slogan }"To get custom, sObject, and sObject field labels, use the identifiers, $Label and $SObjectType in expressions.
All Wizard Components support expressions with the $Label and $SObjectType identifiers.
Note
Expression Syntax for a Custom Label: {! $Label.<Label name with namespace> }
Expression Syntax for an sObject Label: {! $SObjectType.<SObject names with namespace>.label }
Expression Syntax for a Field Label: $SObjectType.<SObject names with namespace>.fields.<SObject Field with namespace>.label }
Examples: {! $Label.cgcloud__NPW_KPI } {! 'Test ' + $Label.cgcloud__NPW_KPI + ' Test' } {! $SObjectType.cgcloud__Promotion__c.label } {! $SObjectType.cgcloud__Promotion__c.pluralLabel } {! $SObjectType.cgcloud__Promotion__c.fields.cgcloud__Slogan__c.label } {! $SObjectType.cgcloud__Promotion__c.label + ' - ' + $SObjectType.cgcloud__Promotion__c.fields.cgcloud__Slogan__c.label }