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

Demo-Extravaganza 2020

Check out these cool Power Apps & vote on your favorite!

secondImage

Robotic Process Automation

Let's talk about the solution provided by Microsoft for Robotic Process Automation (RPA)

secondImage

Community Highlights

Check out whats happening in Power Apps

secondImage

Community User Group Member Badges

FIll out a quick form to claim your community user group member badge today!

secondImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Top Solution Authors
Top Kudoed Authors
Users online (10,249)