cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
strzzz
Level: Powered On

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
Super User
Super User

Re: Set SharePoint form mode based on ListItem value

@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.
2 REPLIES 2
Super User
Super User

Re: Set SharePoint form mode based on ListItem value

@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.
Highlighted
strzzz
Level: Powered On

Re: Set SharePoint form mode based on ListItem value

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
firstImage

Watch Sessions On Demand!

Continue your learning in our online communities.

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

FirstImage

Power Platform World Tour

Coming to a city near you

thirdimage

PowerApps Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

FourthImage

Join PowerApps User Group!!

Connect, share, and learn with your peers year-round

SecondImage

Power Platform Summit North America

Register by September 5 to save $200

Top Kudoed Authors
Users Online
Currently online: 114 members 4,561 guests
Please welcome our newest community members: