cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
PowerappsMax
Helper III
Helper III

Complex Expression Question

Hello, I am building a complex flow for approvals. It involves approvers in a credit card receipt application. 

 

CURRENT SETUP:

Currently, when a user submits a receipt a power automate flow determines who their approver is and creates an "Approval Record" in a table consisting of a matched record ID of the submission and who the approver is. There is a secondary Power App that an approver would log in to and have a gallery filtered to items where they are listed as an approver. Once they click to approve it would consider the record approved and that would be the end of it. (I am not using power automate approvals natively do to the dynamic nature of this process)

 

PROBLEM:

  • Every submitter of a receipt has a default approver
  • Every approver has a $ threshold that they can approve
  • All information is in a SharePoint list configured as below

Sharepoint List Name: approver_table

nameemp_idapproval_threshold
John Doe1234$5000

 

SITUATION:

  • A cardholder submits a receipt for $10,000
  • Their approver (Approver1) can only approve $3000
  • The approver's approver(Approver2) can only approve $8000
  •  The approver's approver approver (Approver3) can approve $15,000

PROBLEM:

The issue here is the cardholder submits a receipt above the threshold their supervisor/approver can approve. The way the system needs to work is that while the 3rd approver has the threshold to approve, the other two still need to be approvers on the record. This is not a static example as there could be situations where the approver's approver has the correct approval limit or there could be situations where there could be up to 5 approvers before someone has the right threshold. I am trying to figure out a way to make it dynamic and below is my thought process.

 

CURRENT SETUP OF APP/FLOW:

What I think needs to happen is when the flow runs use a "Get Items" action and with some type of expression, get records of all the approvers until it finds someone who meets the dollar threshold criteria and then stops getting records. This way it would not get every approver who has a higher approver threshold than the amount that was submitted and then would stop at the first person who has it. From there I think I can manage it. I am just unsure about how to write such expression

 

Please let me know If anyone needs more information on this problem or the process in general!

 

Thank you so much in advance!

1 REPLY 1
eliotcole
Super User
Super User

Have you thought about building hierarchical lists for this?

 

For example, level 1 (lowest), level 2, level 3, etc. This way you can add a people column in each lower level list that contain the people directly above them in the chain of command.

 

Once you have that setup (which should be able to be done), you could optionally set-up secondary, tertiary (etc) columns that also list their higher reports (however that is determined), but that should be tabled for future development.

 

Suffice to say, even if you don't add the secondary/tertiary column, once you have the immediate reports, then you can probably have a MUCH easier time working out any logic you need for automated approvals. 👍

Helpful resources

Announcements
Power Platform Conf 2022 768x460.jpg

Join us for Microsoft Power Platform Conference

The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.

New Ideas Forum MPA.jpg

A new place to submit your Ideas for Power Automate

Announcing a new way to share your feedback with the Power Automate Team.

MPA Virtual Workshop Carousel 768x460.png

Register for a Free Workshop

Learn to digitize and optimize business processes and connect all your applications to share data in real time.

MPA Licensing.jpg

Ask your licensing questions at the Power Automate AMA!

Join Priya Kodukula and the licensing team, super users and MVPs to find answers to your questions on Power Automate licensing.

Users online (2,283)