A Copilot Studio agent needs to collect a customer's order number (format: ORD-followed by 6 digits) before looking up order status. The developer wants the agent to automatically validate the format and re-prompt the user if they provide an invalid input. Which approach should the developer use?
Select an answer to reveal the explanation.
Short Explanation and Infographic
Custom regex entities are built for exactly this — define the pattern once, and Copilot Studio automatically validates input against it and loops back for invalid responses. No Power Fx loops, no flows. Answer: B.
Full explanation below image
Full Explanation
Copilot Studio entities define the type of data that a question node expects. Custom entities support regular expression patterns, which enables format validation with automatic re-prompting built in.
Option B is correct. The developer creates a custom entity with a regex pattern (ORD-\d{6}) and selects that entity as the response type in the question node. When the user provides input, Copilot Studio matches it against the regex. If the input doesn't match, the agent automatically re-prompts the user without the developer needing to write conditional logic or loop constructs. This is the most elegant and maintainable approach.
Option A is incorrect. While a Power Fx condition check after a Text node works functionally, it requires building a loop construct manually (redirect nodes back to the question). This is more complex to build and maintain than using a custom entity with built-in validation.
Option C is incorrect. The built-in Number entity validates that input is a number — but it doesn't enforce the 'ORD-' prefix or the specific 6-digit requirement. An order number like 'ORD-123456' includes letters and a hyphen, so Number entity wouldn't work at all.
Option D is incorrect. Calling a Power Automate flow for simple format validation adds latency (flow invocation overhead) and operational complexity for a task that a regex entity handles natively in microseconds.