cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
daroot
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
v-xida-msft
Community Support
Community Support

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
v-xida-msft
Community Support
Community Support

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.

It's worked!!!

 

Thanks @v-xida-msft

Helpful resources

Announcements
PA Virtual Workshop Carousel 768x460.png

Register for a Free Workshop

This training provides practical hands-on experience in creating Power Apps solutions in a full-day of instructor-led App creation workshop.

Microsoft Build 768x460.png

Microsoft Build is May 24-26. Have you registered yet?

Come together to explore latest innovations in code and application development—and gain insights from experts from around the world.

May UG Leader Call Carousel 768x460.png

What difference can a User Group make for you?

At the monthly call, connect with other leaders and find out how community makes your experience even better.

Top Solution Authors
Top Kudoed Authors
Users online (1,580)