cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Resolver I
Resolver I

help with Leave Request App - Parse Approver from button

Hi All,

 

On the Leave request Demo App, on the Submit request to section in the Approver value used the search function for the 365 users.


What I am trying to do is, is it possible to get this value using the OnSelect button?

 

Let's say, if I have a buttons like HR Manager and District Manager, if requester clicked on HR Manager buttons will update the value for the approver field automatically, and also same if clicked District Manager.

Right now I have a Collection to generate these buttons with field name: level(contain: HR Manager, District Manager) and email (contain: hr@company.com and dstm@company.com).


And on the OnSelect button property: 

Select(Parent);UpdateContext({_selectedApprover:(_selectedLeaveType.description)})

but it's not working.

Thanks for the any help and advice

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Community Support
Community Support

Re: help with Leave Request App - Parse Approver from button

Hi @daroot,

Coud you please share a bit more about your scenario?

Do you want to update the value for the Approver field within the Patch function via clicking a button?

 

I think there is something wrong with the formula that you provided. Your could consider take a try to update the _selectedApprover variable value when you click the "HR Management" button or "District Management" button.

 

I have made a test on my side, please take a try with the following workaround:1.JPG

 

2.JPG

 

 

Within the NewRequestScreen of this template app, add two Button controls (HR Manage button and District Manager button).

Set the OnSelect property of the HR Manage button to following formula:

Set(_selectedApprover,Office365Users.UserProfile("hr@company.com"))

Set the OnSelect property of the District Manager button to following formula:

Set(_selectedApprover,Office365Users.UserProfile("dstm@company.com"))

Note: The _selectedApprover is a global variable rather than a context variable. The _selectedApprover variable initialized within the OnVisible property of the first screen of this template app.

 

Best regards,

Kris

 

 

 

Community Support Team _ Kris Dai
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

2 REPLIES 2
Highlighted
Community Support
Community Support

Re: help with Leave Request App - Parse Approver from button

Hi @daroot,

Coud you please share a bit more about your scenario?

Do you want to update the value for the Approver field within the Patch function via clicking a button?

 

I think there is something wrong with the formula that you provided. Your could consider take a try to update the _selectedApprover variable value when you click the "HR Management" button or "District Management" button.

 

I have made a test on my side, please take a try with the following workaround:1.JPG

 

2.JPG

 

 

Within the NewRequestScreen of this template app, add two Button controls (HR Manage button and District Manager button).

Set the OnSelect property of the HR Manage button to following formula:

Set(_selectedApprover,Office365Users.UserProfile("hr@company.com"))

Set the OnSelect property of the District Manager button to following formula:

Set(_selectedApprover,Office365Users.UserProfile("dstm@company.com"))

Note: The _selectedApprover is a global variable rather than a context variable. The _selectedApprover variable initialized within the OnVisible property of the first screen of this template app.

 

Best regards,

Kris

 

 

 

Community Support Team _ Kris Dai
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

Highlighted
Resolver I
Resolver I

Re: help with Leave Request App - Parse Approver from button

It's worked!!!

 

Thanks @v-xida-msft

Helpful resources

Announcements
secondImage

New Return to Workplace

Reopen responsibly, monitor intelligently, and protect continuously with solutions for a safer work environment.

Experience what’s next for Power Apps

Join us for an in-depth look at the new Power Apps features and capabilities at the free Microsoft Business Applications Launch Event.

Check this Out

Helpful information

Featuring samples like Return to the Workplace and Emergency Response Applications

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,815)