A cloud flow's Dataverse trigger returns an order row whose discount column is sometimes null. A later step multiplies the price by the discount, and the flow must use 0 when the discount is null instead of failing. Which expression should the developer use for the discount value?
Select an answer to reveal the explanation.
Short Explanation
coalesce is the bouncer that waves through the first non-null guest in line. You give it the column first and 0 second, and a null discount quietly becomes zero. The look-alikes either return true or false, convert to text, or expect arrays.
Full Explanation
The coalesce function in workflow expressions evaluates its arguments in order and returns the first value that is not null. Passing the trigger column first and a literal 0 second returns the discount when Dataverse supplied one and 0 when the column was null, so downstream arithmetic always receives a number. The question-mark operator in the property access keeps the lookup itself from failing if the property is missing from the trigger output. The empty function takes a single argument and returns a Boolean that indicates whether a value is empty; it does not accept a fallback argument and cannot produce a number for the calculation. The string function converts its input to text, so a null becomes an empty string and a real value becomes text, and the multiplication then fails or needs another conversion, which is the opposite of what is needed. The union function combines collections such as arrays or objects; with a null or scalar first argument it fails or returns a collection, never a default number. Exam caveat: coalesce returns the first non-null value, not the first non-empty one, so an empty string is returned as is and might need separate handling. Operational check: run the flow once against a row with a discount and once against a row without one, and inspect the evaluated input of the multiplication step in run history.