cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Michelangelo
Level: Powered On

Elaborate Approval Process - NEED Help!

Hello and thank you in advance for reading...

 

Project: Invoice Approval Workflow for various Programs containing various Approvers

 

Foundational Requirements/Understanding:

1. Create a Document Library

2. The Library has 30 folders and each folder's name corresponds to a Program at our company (I.e. "Program Folder A")

3. Accounts Receiveable ("AR") needs the ability to come into Document Library and upload an invoice to a given Program folder (1 of the 30 folders)

4. Every folder has different approvers

5. Each folder contains between 2 and 5 approvers, unique from other folders

6. We need a SharePoint List containing ALL Approvers and their sequence of approval for EACH of the 30 program folders (I.E. "Program Folder A" has Jane Doe as 1st approver and John Smith as 2nd approver)

7. This List will be maintained by "AR" and needs to be updateable

8. ONCE an invoice has been approved by all approvers, then I need to copy the document to a different Document Library (the destination of the invoice will vary depending on the folder it is coming from) - For example "Program Folder A's" file needs to copy to another location intended specifically for "Program Folder A" Contract data stored in a different library on a different site.

 

Flow Logic (Where I need help):

  • I need to create a SINGLE flow that triggers upon document upload, regardless of the folder chosen by "AR"
  • I First need to identify the folder the document was uploaded to
  • Once I know the folder I can call my List of Approvers to the stack
  • Once the List is called upon I then need to Identify all approvers associated to that folder
  • I also need Flow to call to the stack each approvers sequential order (1st, 2nd, 3rd, etc)
  • I then need a traditional linear approval process, first seeking approval from 1st approver, then 2nd and so on
  • All throughout the flow all approvers and the original document uploader (the person in "AR") are receiving email alerts on the overall progress of the approval process
  • IF all approvers approve the document, I then need to copy the document to a specific location in a specific document library on a different site
  • ELSE the Flow stops and Alerts "AR" of the rejecting approvers comments, and instructs "AR" to perform edits and re-upload the document to reinitiate the Flow from the very beginning

 

I started with 

 

Trigger: When a file is created (Properties Only)

Action: Get Lists

Action: Get Item

Action: Switch...

 

But then I realized, right after the Trigger I need to perform an action that identifies the folder, but that is how far I made it before I got stuck -.-

1 ACCEPTED SOLUTION

Accepted Solutions
Michelangelo
Level: Powered On

Re: Elaborate Approval Process - NEED Help!

I ended up coming up with a solution that involved ~100 individual steps within the Flow, but ended up having to go with a SharePoint Trigger: "When a file is created or modified (properties only)" and throughout the flow I had to input terminate steps because all throughout the flow metadata was being updated based on various approver's inputs, and so naturely, the Flow would re-trigger itself... well... because of itself. 

 

The solution was a huge-hit for my stakeholders, but we are working on a "Phase 2" which is now using a list with attachments enabled for the uploading of the document. Utilizing a list + attachments serves the same base requirement, but we can use the SharePoint Trigger: "When an item is created" therefore, we don't have to build in an obsessive amount of necessary Terminates in an attempt to cancel our self-created triggers. 

By converting the Trigger's asset to be a list instead of a library and being able to change the Trigger has SUBSTANTIALLY reduced the necessary steps required in the Flow. Previously, using a library, we were intentionally having to abort on 4 to 6 runs to accomplish a single successful Flow - which was EATING through our monthly Flow allocation. With using a List and the new trigger, 1 flow = 1 success. Furthermore, the speed on Phase 2 is near-instant. 

When using the library it would take 2-3 minutes for the Flow to actually start working because of all the conditions it had to flow through and the various terminations; with Phase 2 flow emails send within 5 seconds after initiating the flow - it's now great!

Contact me if you have a similar project and are seeking help.

4 REPLIES 4
Community Support Team
Community Support Team

Re: Elaborate Approval Process - NEED Help!

Hi @Michelangelo,

 

For your requirement to identify the folder name, you could refer to screenshot below to create the flow:

Capture.PNG

 

The expression in the Compose as below:

last(split(substring(triggerBody()?['{Path}'],0,sub(length(triggerBody()?['{Path}']),1)),'/'))

The flow would run successfully to get the file folder as below:

Capture.PNG

 

Best regards,

Alice

Michelangelo
Level: Powered On

Re: Elaborate Approval Process - NEED Help!

Does the below identify the folder that the file is uploaded to? I did come up with a solution to my problem, but it is long winded solution compared to what you may be suggesting in your post. 

 

flow.png

Community Support Team
Community Support Team

Re: Elaborate Approval Process - NEED Help!

Hi @Michelangelo,

 

You could make a test on your flow to see if your solution could identify the folder that the file is uploaded to.

And you could take a try with my solution and let me know if it works.

 

Best regards,

Alice

Michelangelo
Level: Powered On

Re: Elaborate Approval Process - NEED Help!

I ended up coming up with a solution that involved ~100 individual steps within the Flow, but ended up having to go with a SharePoint Trigger: "When a file is created or modified (properties only)" and throughout the flow I had to input terminate steps because all throughout the flow metadata was being updated based on various approver's inputs, and so naturely, the Flow would re-trigger itself... well... because of itself. 

 

The solution was a huge-hit for my stakeholders, but we are working on a "Phase 2" which is now using a list with attachments enabled for the uploading of the document. Utilizing a list + attachments serves the same base requirement, but we can use the SharePoint Trigger: "When an item is created" therefore, we don't have to build in an obsessive amount of necessary Terminates in an attempt to cancel our self-created triggers. 

By converting the Trigger's asset to be a list instead of a library and being able to change the Trigger has SUBSTANTIALLY reduced the necessary steps required in the Flow. Previously, using a library, we were intentionally having to abort on 4 to 6 runs to accomplish a single successful Flow - which was EATING through our monthly Flow allocation. With using a List and the new trigger, 1 flow = 1 success. Furthermore, the speed on Phase 2 is near-instant. 

When using the library it would take 2-3 minutes for the Flow to actually start working because of all the conditions it had to flow through and the various terminations; with Phase 2 flow emails send within 5 seconds after initiating the flow - it's now great!

Contact me if you have a similar project and are seeking help.

Helpful resources

Announcements
firstImage

Microsoft Business Applications Virtual Launch Event

Watch the event on demand for an in-depth look at the new innovations across Dynamics 365 and the Microsoft Power Platform.

firstImage

Watch Sessions On Demand!

Continue your learning in our online communities.

Power Platform 2019 Release Wave 2 Plan

Power Platform 2019 Release Wave 2 Plan

Features releasing from October 2019 through March 2020.

thirdimage

Flow Community User Group Member Badge

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

fifthimage

Microsoft Learn

Learn how to build the business apps that you need.

sixthImage

Power Platform World Tour

Find out where you can attend!

seventhimage

Webinars & Video Gallery

Watch & learn from the Flow Community Video Gallery!

Top Kudoed Authors
Users Online
Currently online: 134 members 4,590 guests
Please welcome our newest community members: