Question 1
Choose 1
A developer needs to configure a calculation procedure to calculation a subtotal using two different depending on whether the input Boolean variable isCustomer is set to true or false.
How should a developer configure the calculation procedure to conditionally execute the correct formula?
Correct answer:
A. Use two separate Calculation Steps with the Conditional Step property selected: use the ISTRUE (is Customer) and NOT (ISTRUE) (is Customer) functions in the Condition syntax.
Summary
The requirement is to execute one of two different calculations based on the value of a Boolean variable (isCustomer). In a Calculation Procedure, this conditional logic is implemented using the "Conditional Step" property on individual Calculation Steps. This allows the procedure to evaluate a condition for each step and only execute that step if the condition is true, providing a clear, structured way to handle branching logic.
Correct Option
A. Use two separate Calculation Steps with the Conditional Step property selected: use the ISTRUE (isCustomer) and NOT (ISTRUE(isCustomer)) functions in the Condition syntax.
This is the correct and most explicit method. It involves creating two distinct Calculation Steps.
The first step has its Conditional Step property enabled with the condition ISTRUE(isCustomer). This step's formula will only execute if isCustomer is true.
The second step also has Conditional Step enabled with the condition NOT(ISTRUE(isCustomer)). This step's formula will only execute if isCustomer is false.
This ensures that only one of the two calculations runs, providing clean and reliable conditional logic.
Incorrect Option
B. Use two separate Calculation Steps with the Conditional Step property selected: reference just the isCustomer variable in the Conditional syntax (no comparison necessary)
This is incorrect. The condition field must evaluate to a Boolean value. Simply referencing isCustomer without a function or operator is syntactically invalid in the condition syntax. The condition must be a full expression, such as ISTRUE(isCustomer).
C. Use two separate Calculation Steps with the Conditional Step property selected: compare the isCustomer variable directly to the literal true and false values in the Condition syntax.
This approach is flawed. You cannot compare a variable directly to the literals true or false in the Calculation Procedure's condition syntax. The correct way to check a Boolean variable is to use the ISTRUE() or ISFALSE() functions. A direct comparison like isCustomer == true would not be recognized.
D. Use a single Calculation Step with an IF statement directly in the formula definition to reference the isCustomer variable and conditionally perform the appropriate calculation.
While a single complex formula with an IF statement might work in some contexts, it violates the principle of using the dedicated "Conditional Step" feature for this purpose in Calculation Procedures. Using Conditional Steps is the more declarative, manageable, and best-practice approach for this scenario, as it keeps the individual formulas simpler and the logic flow more visible.
Reference
Salesforce OmniStudio Developer Guide: Calculation Step Properties
The requirement is to execute one of two different calculations based on the value of a Boolean variable (isCustomer). In a Calculation Procedure, this conditional logic is implemented using the "Conditional Step" property on individual Calculation Steps. This allows the procedure to evaluate a condition for each step and only execute that step if the condition is true, providing a clear, structured way to handle branching logic.
Correct Option
A. Use two separate Calculation Steps with the Conditional Step property selected: use the ISTRUE (isCustomer) and NOT (ISTRUE(isCustomer)) functions in the Condition syntax.
This is the correct and most explicit method. It involves creating two distinct Calculation Steps.
The first step has its Conditional Step property enabled with the condition ISTRUE(isCustomer). This step's formula will only execute if isCustomer is true.
The second step also has Conditional Step enabled with the condition NOT(ISTRUE(isCustomer)). This step's formula will only execute if isCustomer is false.
This ensures that only one of the two calculations runs, providing clean and reliable conditional logic.
Incorrect Option
B. Use two separate Calculation Steps with the Conditional Step property selected: reference just the isCustomer variable in the Conditional syntax (no comparison necessary)
This is incorrect. The condition field must evaluate to a Boolean value. Simply referencing isCustomer without a function or operator is syntactically invalid in the condition syntax. The condition must be a full expression, such as ISTRUE(isCustomer).
C. Use two separate Calculation Steps with the Conditional Step property selected: compare the isCustomer variable directly to the literal true and false values in the Condition syntax.
This approach is flawed. You cannot compare a variable directly to the literals true or false in the Calculation Procedure's condition syntax. The correct way to check a Boolean variable is to use the ISTRUE() or ISFALSE() functions. A direct comparison like isCustomer == true would not be recognized.
D. Use a single Calculation Step with an IF statement directly in the formula definition to reference the isCustomer variable and conditionally perform the appropriate calculation.
While a single complex formula with an IF statement might work in some contexts, it violates the principle of using the dedicated "Conditional Step" feature for this purpose in Calculation Procedures. Using Conditional Steps is the more declarative, manageable, and best-practice approach for this scenario, as it keeps the individual formulas simpler and the logic flow more visible.
Reference
Salesforce OmniStudio Developer Guide: Calculation Step Properties
