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
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
Regular Visitor

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

Super Users Coming in August

We are excited for the next Super User season.

secondImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Top Solution Authors
Top Kudoed Authors
Users online (7,639)