The main reason for this issue is that after enabling the new analytics engine in Power Apps, the custom component’s "OKClick" and "CancelClick" properties are being interpreted differently.
Previously, Power Apps allowed actions (functions like ResetForm(), Navigate(), etc.) to be executed directly from these properties. However, after enabling the new engine, these properties may now be interpreted as Boolean instead of Action (behavioral functions).
As a result, Power Apps is treating ResetForm(FormEDIT_2); as an invalid Boolean operation instead of an Action, leading to the error:
"Invalid argument type. Cannot use Boolean values in this context."
Possible Solutions
1. Change the Data Type of "OKClick" and "CancelClick" to Action
Since the issue stems from the misinterpretation of these properties, the best solution is to explicitly set their type to "Action".
Steps:
Open your custom component in Power Apps.
Go to the "Custom Properties" section.
Locate "OKClick" and "CancelClick" properties.
Check their data type:
If they are set to Boolean, change them to Action.
Save the changes and test again.
2. Use a Workaround to Execute ResetForm()
If you cannot change the property type, try wrapping ResetForm() inside an If(true, ResetForm(FormEDIT_2)) statement.
If(true, ResetForm(FormEDIT_2))
This forces Power Apps to evaluate it as an action rather than a Boolean value.
3. Use a Global Variable to Trigger ResetForm()
Another approach is to store a Boolean variable and use it in an external event.
Steps:
Set a global variable:
Set(varResetForm, true)
Trigger the form reset in a separate event (e.g., OnVisible or OnSelect of the screen):
If(varResetForm, ResetForm(FormEDIT_2); Set(varResetForm, false))
This ensures that ResetForm() is executed outside the potentially misinterpreted "OKClick" or "CancelClick" properties.
I hope one of these help you!
Best!
Fatih :)