At runtime, if two of the states' condition are true, which state will be displayed?
Show answerHide answer
Correct answer: C The first state with a true condition closest to the top of the canvas
Explanation
ExplanationIn a FlexCard, when multiple states have conditions that evaluate to true for a given record, the card needs a deterministic way to decide which single state to display. It does this by evaluating the states in a specific order.
The key factors are:
Order on the Canvas: States are evaluated from the top of the canvas to the bottom.
Condition is True: The card engine checks each state's condition in this top-down order.
First Match Wins: The first state it encounters (closest to the top) whose condition evaluates to true is the one that gets displayed. The conditions of states lower down on the canvas are not even evaluated once a match is found.
Why This is the Correct Answer:
The description in option C, "The first state with a true condition closest to the top of the canvas," perfectly captures this sequential, top-down evaluation logic. The card doesn't look at all states and then pick one; it starts at the top and stops at the first one that is valid.
Why the Other Options Are Incorrect:
A. The first state with the highest priority closest to the top of the canvas: This is incorrect because FlexCard states do not have a configurable "priority" property. The only inherent priority is their physical order on the canvas. The word "priority" is a distractor.
B. The state closest to the top of the canvas: This is incomplete and therefore misleading. The state at the very top will only be displayed if its condition is true. If the top state's condition is false, the card will move down the list until it finds a state with a true condition.
D. The state with a true condition that has the highest priority: As explained in A, there is no "highest priority" setting for states. This option invokes a non-existent feature.
Best Practice Implication:
This behavior is why a key best practice when designing FlexCards with multiple conditional states is to always have a default state with no condition at the very bottom of the list. This ensures that if none of the conditional states above it are true, there is a fallback state to display, preventing a blank card.
The evaluation flow looks like this:
Check State 1 (Top) Condition -> If true, display it. STOP.
If false, check State 2 Condition -> If true, display it. STOP.
If false, check State 3 Condition -> If true, display it. STOP.
... and so on ...
If all conditional states are false, display the final Default State (with no condition).
Summary / Key Takeaway:
FlexCard state selection is a simple, top-down, first-match-wins process. The visual order of states on the canvas is the single most important factor in determining which state is shown when multiple conditions are true.
Reference:
This behavior is explicitly defined in the Salesforce OmniStudio Documentation for FlexCards under the "Card States" section.