cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
daroot
Level 8

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
Community Support Team
Community Support Team

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
Community Support Team
Community Support Team

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
daroot
Level 8

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

It's worked!!!

 

Thanks @v-xida-msft

Helpful resources

Announcements
thirdimage

Power Automate Community User Group Member Badge

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

sixthImage

Power Platform World Tour

Find out where you can attend!

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

fifthimage

Microsoft Learn

Learn how to build the business apps that you need.

Top Kudoed Authors (Last 30 Days)
Users online (4,840)