cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Helper I
Helper I

Add an Edit button to a single-screen form

I have a 1-screen power app form. I would like to add an Edit button so that when a user opens the form from the SharePoint list, the Edit button will appear and by clicking it, the form then moves to Edit Mode and the button becomes hidden.

 

I also need the button hidden when a new form is created (in other words, the only time the Edit button should be visible is when a user initally opens an existing form).

 

I realize the default SharePoint 'Edit All' button basically accomplishes this, but the business has asked that a custom button to be added.

2 ACCEPTED SOLUTIONS

Accepted Solutions
Highlighted
Helper I
Helper I

Re: Add an Edit button to a single-screen form

Figured it out...went to the Visible property in the Advanced menu and entered:

 

SharePointForm.Mode=FormMode.View

 

This fixed that issue, but now have a new one. What do I enter in the OnSelect for the Edit button to move the form to the Edit mode? Remember, this is a single screen form. I am not using multiple screens.

View solution in original post

Highlighted
Helper I
Helper I

Re: Add an Edit button to a single-screen form

Figured this one out as well

 

Used EditForm(SharePointForm1);Navigate (SharePointForm1, ScreenTransition.None)

 

Both issues resolved...Edit button now only appears when an existing record is opened. After clicking Edit button, button is hidden and form moves from View mode to Edit mode.

View solution in original post

6 REPLIES 6
Highlighted
Resolver II
Resolver II

Re: Add an Edit button to a single-screen form

I assume you are using an embedded powerapp in sharepoint.

You basically need to use a variable set it to true when the page is visible and set the buttons visibility to the value of the variable.

You would then update the variable when the button is clicked and thus making it invisible.

You could probably use the same variable to change the display mode of the form

I hope this helps.
Luke
Highlighted
Community Support
Community Support

Re: Add an Edit button to a single-screen form

Hi @ZF-AtPride ,

Could you tell me

1)Before you click the edit button, what's the form's mode? or maybe it is invisible until you click the button?

2)When will the edit button appear? Do you want it appears just when you edit the form? Will the button appear when you view form and create new record?

 

I assume that

1)Before you click the edit button, the form is invisible. If you click the edit button, the form becomes visible and mode is edit.

2)The edit button only appears when you edit the form.

Based on your description, I've made a similar test for your reference:

1)customize the form in PowerApps8291.PNG

 

2)Set FormScreen1's OnVisible:

If(SharePointForm1.DisplayMode=DisplayMode.Edit,Set(var,true))

3)Set edit button's Visible: var

  Set edit button's OnSelect: 

Set(var,false)                 //use a variable to change the button's visible

4)Set SharePointForm1's Visible:

If(Button1.Visible=true,false,true)

8292.PNG

Please note that Visible is an input property, you could not set it outside.

 

 

Then, when you edit a record, firstly it only appears en edit button , if you click the button, the edit form will appear.8293.PNG

 

 

Best reagrds,

Community Support Team _ Phoebe Liu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Highlighted
Helper I
Helper I

Re: Add an Edit button to a single-screen form

Hi Phoebe...thank you for your quick response.

 

I have included answers to your questions below. I hope they will help clarify what I'm trying to accomplish.

 

1)Before you click the edit button, what's the form's mode? or maybe it is invisible until you click the button?

Before clicking the Edit button, the form is in View mode. In other words, a user opens a previous record from the SharePoint list and to view the form where they can see and click the Edit button in order to update or modify the form. In all other modes, the Edit button should be hidden.

 

2)When will the edit button appear? Do you want it appears just when you edit the form? Will the button appear when you view form and create new record?

The Edit button should only appear in View mode when a user opens a previous record from the SharePoint list to view the form. After clicking Edit, the button should not be visible. The button should not appear when creating NEW records.

 

I attempted what you described in my PowerApp and ran into a couple of issues 1) The Edit button appeared on the form when creating a new record and 2) When opening an existing record, SharePointForm1 was blank. The previous data that was entered on the existing record should be visible in the form.

Highlighted
Helper I
Helper I

Re: Add an Edit button to a single-screen form

Figured it out...went to the Visible property in the Advanced menu and entered:

 

SharePointForm.Mode=FormMode.View

 

This fixed that issue, but now have a new one. What do I enter in the OnSelect for the Edit button to move the form to the Edit mode? Remember, this is a single screen form. I am not using multiple screens.

View solution in original post

Highlighted
Helper II
Helper II

Picture keeps moving when scrolling down.

I added an image to the page but when I scroll down the image moves down. Could you help me out ?

Highlighted
Helper I
Helper I

Re: Add an Edit button to a single-screen form

Figured this one out as well

 

Used EditForm(SharePointForm1);Navigate (SharePointForm1, ScreenTransition.None)

 

Both issues resolved...Edit button now only appears when an existing record is opened. After clicking Edit button, button is hidden and form moves from View mode to Edit mode.

View solution in original post

Helpful resources

Announcements
Check this Out

Announcing

Class of 2020- Season 2

Check this Out

Helpful information

Featuring samples like Return to the Workplace and Emergency Response Applications

August 2020 Community Challenge: Can You Solve These?

August 2020 Community Challenge: Can You Solve These?

We're excited to announce our first cross-community 'Can You Solve These?' challenge!

secondImage

Return to Workplace

Reopen responsibly, monitor intelligently, and protect continuously with solutions for a safer work environment.

secondImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Top Solution Authors
Top Kudoed Authors
Users online (8,894)