Hi
I have a Sharepoint List with a customized Power Apps form attached.
The form has a number of icons that show (Visible = true) set to show based on the input field meeting validation requirements. Further there are error message boxes who visible property is dependent on the icon type (Cancel) AND visible (true)
A single button "Submit" calls SubmitForm(SharePointForm1) and according to documentation if this success calls OnSuccess where I have a series of ico_FirstName.Visible = false statements for all the icons they do not hide.
Regardless of where I try to reset icon to visible = false they will not hide and the error message keeps appearing.
All I want to do is reset a form back to default.
Trying to figure out how to reset the icons to visible = false on a SubmitForm (as the
Thank you!!. I already have a context variable and using Concurrent in OnSuccess has solved the problem.
Use Context Variables: For each icon, instead of setting its Visible
property directly, tie it to a context variable, like this:
// For icon named ico_FirstName, the Visible property
varIcoFirstNameVisible
Initialize Context Variables: In the specific screen your form is on, for Screen.OnVisible
, initialize the context variables
UpdateContext({varIcoFirstNameVisible: false, varIcoLastNameVisible: false, ...})
Form visibility of fields set to true: I presume your current logic sets the appropriate values to true
, but you may want to adjust them to use the context variables instead of directly setting them
Reset Form and Icons in OnSuccess
: In the OnSuccess
property of your SharePoint form, you can both reset the form and the visibility variables:
Concurrent(
ResetForm(SharePointForm1),
UpdateContext({varIcoFirstNameVisible: false, varIcoLastNameVisible: false, ...})
)
See if it helps @bozo88
Stay up to date on forum activity by subscribing. You can also customize your in-app and email Notification settings across all subscriptions.