Study FAQ
How do I validate typed inputs before comparing them in a Power Automate condition?
Also asked as 2
- How can I keep text, numbers, and Booleans from being mixed up in a cloud flow?
- How do I check input types and expression context in Power Automate?
Answer
Define the input contract and validate data before evaluating a Power Automate condition. Distinguish a Boolean from the string "true", a number from numeric text, and a single object from an array. Decide separately how to handle omitted, null, and empty values. If a quantity must be an integer, reject invalid values in an earlier branch before calling a numeric comparison.
For example, after validating the schema of an array, an expression within its loop can test whether the current item is ready and has high priority:
and(equals(item()?['ready'], true), greater(item()?['priority'], 2))
Here item() refers to the current loop item. A trigger condition must instead refer to the relevant trigger payload. Use the syntax expected by your editor, including the leading @ in a trigger condition. Compare raw Dataverse Choice values against the expected raw values. Inspect the action inputs and outputs to confirm the actual property names and types.
In a development flow, try a valid item, a missing value, numeric text, and a Boolean-looking string. Confirm that validation rejects the wrong shapes before any write and that the intended items reach the business branch.
Microsoft references
Full explanation
AB-400: Reliable Cloud Flows and Copilot Studio Workflows
Study guide · AB-400
Read the full explanation