cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
mhabig1
Helper I
Helper I

Flow based on multiple conditions

I have created a flow that moves documents from SharePoint library to library, when it reaches one of the libraries they will have to choose from a choice column on who reviews the document next, which makes it a condition, so if the condition is met it could go to a,b,c,d,e,f,g,h,i,j. What is the best way to create this flow. Who ever receives the document will edit it, then choose multiple editors, based on SharePoint column choice. This is what I have so far...

  1. When Item is Created or Modified
  2. Get file metadata
  3. Condition (which is 12 possible choices) this is the part I'm having an issue with
    If yes
    Send email
  4. Copy file
  5. Delete file
1 ACCEPTED SOLUTION

Accepted Solutions

@mhabig1 

Hiya. Good catch!  It's super helpful to think through these things on the front end like you have rather than waiting until something breaks 🙂

 

So, this is a process thing now, right?  Not so much a system thing.  So you'll probably want to think through some of the following:

  • Do you want to allow the file to be moved manually?  (It's ok if you do, but sometimes it helps to stretch the current process rather than build automation to account for the manual intervention).
  • Would it make sense to immediately move the file into a holding folder?
  • Would it make sense to make the 'decision field' required so the file can be routed to the correct folder first?

Loads of options depending on the latitude you have with the process, but given what you've presented so far, here's one approach:

 

With your flow as it is currently designed, after the delay it will try to get the file properties...but if the file isn't there, it will error out ya?  This gives us an opportunity to use the "Run After" capabilities in Power Automate to build a "Try Catch Finally" process that developers typically use for error handling.  It's not as complicated as it sounds, and here's an article I did covering exactly this kind of thing:  Using "Run After" as a Condition in Power Automate / Flow

 

If it errors out, you could have it send an email to you or something, but I don't know if you'll be able to tell if the file was manually moved into the correct folder.

 

Keep at it, you're doing great!

-Ed

 

 

If you liked this reply, please give it a thumbs up! If this reply has answered your question or resolved your challenge, please consider marking it as a Solution. This helps other users find it more easily via search.

View solution in original post

3 REPLIES 3
edgonzales
Super User II
Super User II

@mhabig1 

Hi there.  Check out the Switch action.  It lets you essentially have a condition with non-binary (true/false) results.

 

I cover it a little bit in this article:  Calendar Sync with Switch in Power Automate / Flow

 

Keep us posted.

-Ed

 

If you liked this reply, please give it a thumbs up! If this reply has answered your question or resolved your challenge, please consider marking it as a Solution. This helps other users find it more easily via search.

@edgonzales  thanks Ed for responding, so I have the switch statement in and here's the flow so far.

When a file is created or modified (properties only)

Delay (7 days due date) this is where my new issue is, what do I  do if the file is moved manually, before due date?

Get file properties

Get file metadata

Apply to each/Switch Statement (which are the 12 possible choices)

Copy file

Delete file

 

mhabig1_0-1594903326133.png

 

@mhabig1 

Hiya. Good catch!  It's super helpful to think through these things on the front end like you have rather than waiting until something breaks 🙂

 

So, this is a process thing now, right?  Not so much a system thing.  So you'll probably want to think through some of the following:

  • Do you want to allow the file to be moved manually?  (It's ok if you do, but sometimes it helps to stretch the current process rather than build automation to account for the manual intervention).
  • Would it make sense to immediately move the file into a holding folder?
  • Would it make sense to make the 'decision field' required so the file can be routed to the correct folder first?

Loads of options depending on the latitude you have with the process, but given what you've presented so far, here's one approach:

 

With your flow as it is currently designed, after the delay it will try to get the file properties...but if the file isn't there, it will error out ya?  This gives us an opportunity to use the "Run After" capabilities in Power Automate to build a "Try Catch Finally" process that developers typically use for error handling.  It's not as complicated as it sounds, and here's an article I did covering exactly this kind of thing:  Using "Run After" as a Condition in Power Automate / Flow

 

If it errors out, you could have it send an email to you or something, but I don't know if you'll be able to tell if the file was manually moved into the correct folder.

 

Keep at it, you're doing great!

-Ed

 

 

If you liked this reply, please give it a thumbs up! If this reply has answered your question or resolved your challenge, please consider marking it as a Solution. This helps other users find it more easily via search.

View solution in original post

Helpful resources

Announcements
Process Advisor

Introducing Process Advisor

Check out the new Process Advisor community forum board!

MPA 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

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 (3,034)