web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Clear form viewer when...
Power Apps
Answered

Clear form viewer when starting the app

(0) ShareShare
ReportReport
Posted on by 4

Hi Everyone,

Teaching myself powerapps and want to create a simple add new user request. The app is connected to SharePoint Online List.

I have a home screen with a button to start the new user request and below it is a form viewer that I want to be not visible on start but when the request is submitted shows the latest list entry which should be the one the user just entered.

On the FormViewer Item field I have - Last(Sort('New Users',ID,Ascending)). This gives me the latest user created but it carries over to the next time the app is started.

 

Any advice would be appreciated.

 

FormViewerFormViewer

Categories:
I have the same question (0)
  • Drrickryp Profile Picture
    Super User 2024 Season 1 on at

    @Greg-au 

    To avoid delegation problems you want First(Sort('New Users',ID,Descending)).  Your formula will max out at 2000 names (if you have increased File>Settings>Advanced Settings>Data row limit to 2000 from the default of 500.  

  • Greg-au Profile Picture
    4 on at

    @Drrickryp , Thanks for responding and will look at that change.

    Any advice on how to have the formviewer not visible until a user has submitted a request?

    By default I have FormViewer1 set to visible=false

    I was looking at the submit form icon and trying to figure out how to then set FormViewer1 to visible to show/confirm what they just requested.

    I have tried SubmitForm(EditForm1); FormViewer1.Visible=true

    Any thoughts

  • Verified answer
    Drrickryp Profile Picture
    Super User 2024 Season 1 on at

    @Greg-au 

    You can use a context variable to either true or false as the result of a condition.   If you want it hidden by default, then in the OnVisible property of the  Screen containing the Viewform put

     

    UpdateContext({visvar:false})

     

    Then set the Visible property of the FormViewer to visvar. 
    The SubmitForm icon should never have anything other than SubmitForm(FormX) as its OnSelect property.  The OnSuccess property of the form itself is be used to change the context variable.  This formula should be in the OnSuccess property of the form

     

    UpdateContext({visvar:true})

     

    That way, the form would not be shown unless the form was successfully submitted.  As soon as the data is successfully submitted, the View form would be unhidden.  If you had an Edit form on the same screen, then the Edit form Visible property would be set to !visvar.  That would toggle the View form and and Edit form so either one or the other was hidden when the other form was visible. 

    Another trick is to create a toggle button that hides and unhides the forms.  The OnSelect property of a button or Icon with the formula

    UpdateContext({visvar:!visvar})

    would do that.  

      

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

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the July Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 345 Most Valuable Professional

#2
11manish Profile Picture

11manish 207 Super User 2026 Season 2

#3
Mohsin Ali Profile Picture

Mohsin Ali 177

Last 30 days Overall leaderboard