Skip to main content

Notifications

Power Apps - Building Power Apps
Answered

SubmitForm - Hiding Icons afterwards

Posted on by 25

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

  • bozo88 Profile Picture
    bozo88 25 on at
    Re: SubmitForm - Hiding Icons afterwards

    Thank you!!. I already have a context variable and using Concurrent in OnSuccess has solved the problem.

     

     

  • Verified answer
    poweractivate Profile Picture
    poweractivate 11,103 on at
    Re: SubmitForm - Hiding Icons afterwards

    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 

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

November 2024 Newsletter…

November 2024 Community Newsletter…

Community Update Oct 28…

Power Platform Community Update…

Tuesday Tip #7 Community Profile Tips…

Welcome to a brand new series, Tuesday Tips…

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 143,591

#2
RandyHayes Profile Picture

RandyHayes 76,308

#3
Pstork1 Profile Picture

Pstork1 64,090

Leaderboard