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

How to set a SP field's value on the click of a button

Hi,

 

I customized a SharePoint list form and I would like to use the out of the box "save" to save the entries on the form. However, I would like to add a button with "submit" clicking on which will set the form to read only to the current logged in user and also update the status field to "Ready for review".

 

For the current logged in user's manager, the form should be editable regardless of the status. 

 

Please advise,

2 REPLIES 2
Community Support Team
Community Support Team

Re: How to set a SP field's value on the click of a button

Hi @cooltechie,

 

First of all, you must have the stationary current loggin user to make this work. I mean that you need to know you want "User1@contoso.com" to have the read only form. And you need to have Azure AD connector to know the user's manager's information.

 

If both conditions fit, then you need to add a Office365 users connector to the app. Then set below formula in the OnSelect property of your submit button:

Set(Var,If(User().Email=Office365Users.Manager("User1@contoso.com").Mail,Edit, User().Email="User1@contoso.com",View))

Then set the DefaultMode of the form to:

Var

Regards,

Mona

 

Community Support Team _ Mona Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
cooltechie
Level: Powered On

Re: How to set a SP field's value on the click of a button

Hi Mona,

 

Thank you for your response. My requirement is slightly different. I would like to use "submit" button to set a SharePoint field value and then also make the form read-only to the user who submitted it but editable for his manager.

 

 

Helpful resources

Announcements
firstImage

PowerApps Monthly Community Call!

Join us next Wednesday for our Demo Extravaganza, October 16, 2019 8am PDT.

firstImage

Microsoft Business Applications Virtual Launch Event

Join us for an in-depth look at the new innovations across Dynamics 365 and the Microsoft Power Platform.

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: 462 members 4,514 guests
Please welcome our newest community members: