cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Big_S
Post Patron
Post Patron

Approval workflow and process

Hi Guys,

Does anyone knows how to execute this scenario:
If the amount of the requestor is 0 - 100,000 received by approver 1
If the amount of the requestor is 101,000 - 500,000 received by approver 2

If the amount of the requestor is 501,000 - 1,000,000 received by approver 3

If the amount of the requestor is above 1,000,000 received by approver 4

 

here's my code but it doesn't work

 

If(
Value(TotalAmount_4.Text) <= 100000,
LookUp('[dbo].[Employee]',EmployeeEmail=Label11.Text, approver1),
Value(TotalAmount_4.Text) > 100000 && Value(TotalAmount_4.Text) <= 500000,
LookUp('[dbo].[Employee]',EmployeeEmail=Label11.Text, approver2),
Value(TotalAmount_4.Text) > 1000000,
Office365Users.UserProfile("approver4@mail.ph").Mail,
Value(TotalAmount_4.Text) > 500000 && Value(TotalAmount_4.Text) <= 1000000,
Office365Users.UserProfile("approver3@mail.ph").Mail

 

1 ACCEPTED SOLUTION

Accepted Solutions

Hi @mdevaney  @jlindstrom 

 

I think I have solved the problem I missed something but thank you for taking the time to look into my concern. 🙂

View solution in original post

7 REPLIES 7
mdevaney
Super User III
Super User III

@Big_S 
What do you want to happen in your app after the proper approver is determined?  Please let me know.

 

I do not understand what should happen based on your code.  Currently, it calls the UserProfile from Office 365 and gets the email address but it doesn't save the email address anywhere.  Are you trying to send an email? 

 

---
Please click "Accept as Solution" if my post answered your question so that others may find it more quickly. If you found this post helpful consider giving it a "Thumbs Up."

jlindstrom
Super User
Super User

Why not use an approval flow? 

Hi @mdevaney 

 

Thanks for looking into my query. I wanted to tag properly the approver of the designated amount what happened when I request for the amount of 1,000,000.000 the amount did not route as expected, approver4 received the request the right approver for the amount is approver3. 

Hi @jlindstrom 

 

Thank you also for looking into my query. I did use Flow but I have issues on tagging the right approver after tagging exact approver I will click the submit button and the Flow approvals will execute.

@mdevaney 

 

I think my IF function has something wrong?

Hi @mdevaney  @jlindstrom 

 

I think I have solved the problem I missed something but thank you for taking the time to look into my concern. 🙂

View solution in original post

v-xida-msft
Community Support
Community Support

Hi @Big_S ,

Have you solved your problem?

 

Based on the formula that you provided, I could not find any syntax error with it. If you have solved your problem, please consider go ahead to click "Accept as Solution" to identify this thread has been solved.

 

Set the Text property of a Label to following:

If(
   Value(TotalAmount_4.Text) <= 100000,
   LookUp('[dbo].[Employee]',EmployeeEmail=Label11.Text, approver1),
   Value(TotalAmount_4.Text) > 100000 && Value(TotalAmount_4.Text) <= 500000,
   LookUp('[dbo].[Employee]',EmployeeEmail=Label11.Text, approver2),
   Value(TotalAmount_4.Text) > 1000000,
   Office365Users.UserProfile("approver4@mail.ph").Mail,
   Value(TotalAmount_4.Text) > 500000 && Value(TotalAmount_4.Text) <= 1000000,
   Office365Users.UserProfile("approver3@mail.ph").Mail
) 

then specific email address would be displayed in the Label based on the entered Total Amount value.

 

Best regards,

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.

Helpful resources

Announcements
PA User Group

Welcome to the User Group Public Preview

Check out new user group experience and if you are a leader please create your group

Power Query PA Forum 768x460.png

Check it out!

Did you know that you can visit the Power Query Forum in Power BI and now Power Apps

V3_PVA CAmpaign Carousel.png

Community Challenge - Giveaways!

Participate in the Power Virtual Agents Community Challenge

Carousel 2021 Release Wave 2 Plan 768x460.jpg

2021 Release Wave 2 Plan

Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.

Top Solution Authors
Top Kudoed Authors
Users online (2,393)