Applies to Product -Power Apps
What’s happening?
Customers encounter an error when attempting to execute a patch command in a Power Apps application. The error message states: "The type of this argument does not match the expected type 'OptionSetValue (Ext UFR (Roadmaps))'. Found type 'Error'." This issue arises when the application is in design mode, while the patch command works correctly in play mode.
Reason:
The underlying cause of this is related to the handling of a choice column in Dataverse. Specifically, the error occurs when the patch command is trying to update a choice column with a value that does not match the expected type. This can happen if the control used to input the value does not provide a valid option from the choice column.
Resolution:
- Ensure that the control used to input the value for the choice column is correctly configured. It is recommended to use a dropdown or combo box control that allows users to select from the available options in the Dataverse choice column.
- If the error persists, try commenting out the new field that was added to the patch command to see if the issue resolves. This can help identify if the new field is causing the error.
- Create a simple test app to isolate the issue. Add a single button with the patch command and the necessary data source to see if the error continues. This can help determine if the problem is with the original app or the patch command itself.
- Review the OnChange properties of the data entry fields to ensure they are correctly triggering the patch command without introducing errors.
- If necessary, consult the documentation on how to create a minimal repro canvas app to further isolate the issue.
