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.

View solution in original post

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.

View solution in original post

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
Better Together’ Contest Finalists Announced!

'Better Together’ Contest Finalists Announced!

Congrats to the finalists of our ‘Better Together’-themed T-shirt design contest! Click for the top entries.

thirdimage

Power Apps Community User Group Member Badge

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

sixthImage

Join THE global Microsoft Power Platform event series

Attend for two days of expert-led learning and innovation on topics like AI and Analytics, powered by Dynamic Communities

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

thirdimage

Community Summit North America

Innovate, Collaborate, Grow - The top training and networking event across the globe for Microsoft Business Applications

Top Solution Authors
Top Kudoed Authors
Users online (9,126)