This blog demonstrates one of several ways to display Business Validation Message to be rendered as Errors in Canvas Apps when User Create or Update record in Canvas Power Apps.
Developers need to show Validation Messages thrown by D365 CRM Plugin to be rendered as Errors in Canvas Power Apps where D365 records are created or updated by using Power Automate.
Below are steps needed to be followed to display Error Messages.
- Create variables for Message & MessageType of type String and initialize default value as a successful scenario for record creation in D365 as below
- Set Variable VarMessageType should run after your CDS Action has failed
- Set Variables for the Error scenario with below settings MessageType – ‘2’ Message – message attribute of a body for action of CDS
- Add action Respond to PowerApp or Flow with output as below
- Set Action Respond to a PowerApp to run after successful or skipped
- Handle the MessageType return in Save Action button in Power Apps.
- You can set only 1 Response to a PowerApp action in single Power Automate.
Conclusion : Hope above blog gives an option for Error handling in Power Apps for records created using Power Automate.