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.
FormViewer
Solved! Go to Solution.
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.
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.
@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
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.
Check out new user group experience and if you are a leader please create your group
Did you miss the call?? Check out the Power Apps Community Call here!
See the latest Power Apps innovations, updates, and demos from the Microsoft Business Applications Launch Event.
User | Count |
---|---|
258 | |
239 | |
83 | |
36 | |
28 |
User | Count |
---|---|
307 | |
268 | |
121 | |
68 | |
46 |