cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Regular Visitor

Set SharePoint form mode based on ListItem value

I cannot find how to set SharePointForm1 mode based on item value. Say I have Status field in my SharePoint list and I want to set form to FormMode.View if Status="Approved".

 

So far I tried changing OnEdit formula in SharePointIntegration to this:

If(SharePointIntegration.Selected.Status= "Approved",ViewForm(SharePointForm1),EditForm(SharePointForm1))

 

It seems that SharePointIntegration is still not loaded at this point, so value is not read and form opens in Edit mode. This happens if I select the item in SharePoint and click Edit button from the menu.

 

Then I tried setting the same formula in OnVisible event in FormScreen1, but it it is also not working.

 

How would I archieve this result ?

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Super User III
Super User III

@strzzz 

Try taking a look at the DefaultMode property of the SharePointForm1.

Consider trying this as your formula for that property:

If(SharePointIntegration.Selected.Status= "Approved",View,Edit)

I hope this is helpful for you.

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up. Solved your problem? - Click on Accept as Solution. Others seeking the same answers will be happy you did.
Check out my PowerApps Videos too!

View solution in original post

2 REPLIES 2
Highlighted
Super User III
Super User III

@strzzz 

Try taking a look at the DefaultMode property of the SharePointForm1.

Consider trying this as your formula for that property:

If(SharePointIntegration.Selected.Status= "Approved",View,Edit)

I hope this is helpful for you.

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up. Solved your problem? - Click on Accept as Solution. Others seeking the same answers will be happy you did.
Check out my PowerApps Videos too!

View solution in original post

Highlighted

Perfect. Your solution filled the gap which I was missing. It works when user select item in SharePoint list and clicks Edit. 

thanks a lot

Helpful resources

Announcements
Community Conference

Power Platform Community Conference

Check out the on demand sessions that are available now!

News & Announcements

Community Blog

Stay up tp date on the latest blogs and activities in the community News & Announcements.

secondImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Community Highlights

Community Highlights

Check out the Power Platform Community Highlights

Top Solution Authors
Top Kudoed Authors
Users online (3,107)