Settings Items property of a Power App form via a Global Variable. Creating an item without using a New Form.

 Today we will see an interesting scenario where in instead of setting the Items property to a list we assign it to Global variable.

What happens in here is we use the same formula's that we use to patch a new item and patch an existing item into a list. But we tweak it a little.

The advantage of this form is we don't need New Form, We can achieve everything using the EDIT form.

So lets gets started. 

Suppose you wish to open a New form. 

All you will do is add the form on the screen. This form by default is EDIT, by EDIT i mean the display mode for this form is EDIT.





So now we go to the screen from where we call in this from. Lets take an icon, you can even have a button if you want.

Now OnSelect property of this button, we will need to initialize a variable that we will then put as the value of items property of the above form.


Set(varFormData,Defaults(Programs));Navigate('Program Screen',ScreenTransition.Fade);

What we do in here is we set a variable varFormData, and set its value to Defaults(ListName)

And that's it.

Now all there that is left to do is go to your Form Screen and set the value of Item property of the form.

And this should be set to the varFormData variable.



And that's it. Now you don't need New form. You can use the DisplayMode = EDIT for the New Form.

In the next blog i will even show you how to control the view form via setting a variable.

Comments

Popular posts from this blog

Creating Nested Galleries in Power Apps. (Parent-Child Relationship)

How to reset a datepicker control in PowerApps?

Reset () function failing to work on Edit form for Combo boxes in Power App.