cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Anonymous
Not applicable

FLow that move files to different folders based on conditions in files

Hi! I´m getting really frustrated on this and really need help.

 

I have setup a flow that gets email attachments from a mailbox to a sharepoint folder.

When the file gets loaded to the folder a new flow triggers and convert the word file to pdf and also OCR the file.

This all works fine.

 

Now I want a flow that moves the file based on different conditions to different folders in SharePoint.

 

I have 3 different folders setup:

Invoices
Cuscontracts
Supcontracts.

 

If the filname itself contains one of this words or if the document content (OCR Layer) contains one of this words it should move the file automatically to the right folder.

 

I have managed to create the conditions and it works fine when I only have conditions setup for one of the folders. But when i setup all three conditiontypes it just gets error, it doenst seem to skip the first conditions if it does not find the words and move on to next, it just fails.

 

How can I achieve this? I´m using encodian for ocr.

Any help would be appreciated.1.PNG2.PNG3.PNG4.PNG5.PNG

 

I´m no expert in this so pleas be firm with me. The images is sadly in Swedish.

THX!

1 ACCEPTED SOLUTION

Accepted Solutions

@Anonymous 

It means the conditions on your filters did not return a 'yes' result... in essence the actions were never reached. The easiest way to verify this is put a terminate action in the 'If No' channel.

I'd suggest simplifying your conditions until they work and the re-add, testing each time you make an iteration.

View solution in original post

6 REPLIES 6
Jay-Encodian
Community Champion
Community Champion

Hey @Anonymous 

This approach should work for you... I've mocked the 'PDF Text Layer' from the Encodian action in my example as it's just a string. 

In essence I have created a parallel branch for each folder and then use a condition (could be multiple) to check if the text layer provided contains a certain value... if it does then set a variable with the SharePoint folder path where I want to upload the document to 🙂

Overview

o.jpg

 Breakdown showing just one of the branches:

o2.jpg

There is probably a more elegant way to do this with expressions, but its good to start simple and check if you can reduce after. Just be mindful nested if expressions can be difficult to support and update at a later date.

HTH

Jay

Anonymous
Not applicable

Thanks for fast reply! I will try this out during the day!

I´ll get back to you if it works!

Thx again for taking time! 🙂

Anonymous
Not applicable

Hi! Still got the same fault when running the flow, everything looks ok, but it just skipps the create file flow... 😞
fel2.PNGfel.PNG

Anonymous
Not applicable

ActionBranchingConditionNotSatisfied. The execution of the template action Move_file was skipped: the branching condition for this action was not met.

What does this even mean?

@Anonymous 

It means the conditions on your filters did not return a 'yes' result... in essence the actions were never reached. The easiest way to verify this is put a terminate action in the 'If No' channel.

I'd suggest simplifying your conditions until they work and the re-add, testing each time you make an iteration.

Anonymous
Not applicable

Hi! I finally managed to get this to work. My main problem was that my conditions was somewhat wrong and that I had filtered views in SharePoint library. I did as you said and simplified and re-added and finally got it to work! 🙂 Thank you for the support!

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,118)