Introduction: In this article, I will be representing to open form as a new form for the items in PowerApps as well as in edit form in PowerApps. I have tried to provide the scenario with solutions in the below steps.

Scenario

One of the most fundamental requirements is opening a form in a different mode depending on the requester or user. This article will discuss how to open different ways of new, display, and edit in the same form. This solution is the foundation of Power Apps. On top of this, further functionalities could be added.

I’ve a common gallery with one button to create an item and icon,When a user clicks on the button, the form opens in a new form, and when the user clicks on the arrow icon, the form opens in the edit form.

Here is my gallery with a button and icons to perform the specific action.

Navigate the form depending on the requirement.

There are 3 properties on which the form could be navigated

Below are examples for OnSuccess and OnFailure. In the below example, Back() navigates to the gallery back.

OnSuccess

OnFailure

Save button functionality

On the Save button On Select property, all the logic/validation could be written; all the variables could be reset, which could be used for validations. In the end, the Form could be submitted with the below methods. All the functions could be separated with a comma separated, as shown below.

On Edit Form, we need to pass the variable so that Edit Form understands which item details are to be displayed. For me, ActionForm is playing the role of Edit Form.

On click of the arrow, the form opens in the edit form for that particular item from the gallery

We shall see how the form will navigate from the display form to the edit form.

The screenshot below shows how to open the form in view form.

Now in display form, an icon will be provided to open the edit form. Without any action from the display form, the edit form can not open.

Here is the screenshot of the display form.

After the Edit button is clicked, On Edit button the formula will be like

Here the formulas i used for the gallery and form.

Next Arrow ->onselect->ResetForm(Form1);EditForm(Form1);Navigate(Editform,BorderStyle.None,{View:ThisItem})

Createbutton->onselect->ResetForm(Form1);NewForm(Form1);Navigate(Editform)

Form->Defaultmode->Edit

Item->View

OnSuccess->Notify(“Your request has been accepted”,NotificationType.Success,2000);Back();

OnFailure->Notify(“Your request has been Failure”,NotificationType.Error,2000);Back();

Editbutton->onselect->ResetForm(Form1);EditForm(Form1);Navigate(Editform)

Savebutton->onselect->SubmitForm(Form1);Set(varShowpop,false);

After the Edit button is clicked, On Edit button the formuOnce the Edit form opens edit button visibility property can have its formula to hide the button.

The home button has the formula to navigate back to the gallery, and the formula is Navigate(screenAllItems) on the OnSelect property.

The save button will have the same formula, just like the new formula will be like

For any Help or Queries Contact us on info@crmonce.com or +918096556344