cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
mdemarici
Frequent Visitor

Move files from my companies SharePoint Site to our clients site based on metadata tags.

My objective is to be able to upload a document in our document library, tag it with metadata including the client's name, doc type, etc. and have it automatically move to our client's site based on the tags. I think this can be done with a flow, but I am concerned that our folder structure will get in the way. 

 

Currently, our Doc Library and Clients Site's Doc Library is set up with a multi-level folder structure. There are about 400 folders in our library and about 100 in our clients sites. Would it be better to have a flat structure in order to perform this automation?

 

A visual of my companies and our client's folder structure

 

Folder 1 - Microsoft

Folder 2 - Apple

Folder 3 - AMD

Folder 4 - XYZ

 

inside of each of these folders are subfolders...

 

Folder 1 - Legal

Folder 2 - Financial

Folder 3 - Reports

Folder 4 - Transactions

 

Inside each of these folders are folders that correspond with the year. 

 

This would be the ideal scenario if everything worked correctly...

 

I (Marcus) receive documents for my clients, Daniel and Chris from a company that we both deal with, let's call it Microsoft. I download the files and navigate to the Microsoft Company folder then to the financial documents subfolder then to then 2020 folder. I drag the files into the window to upload them, hit quick edit, and tag each file with Metadata (clients name, doc type, etc). Once I am done tagging, an automated flow moves Chris's file to his SharePoint site and Mike's to his. Chris and Mike can only see documents tagged with their names, and they can also see that the document is in their Microsoft folder in the Financial Documents subfolder. 

 

Is this possible with multi-level folders? It is to my understanding I would have to map the target folder to the source folder, doing this would take a lot of time considering there are about 5 subfolders in each Company folder. Would it be better if I was working with a flat structure with only metadata columns?

 

My company and my clients are used to using the folders, I would like to figure out a way where I can keep the folder structure, but I'm unsure whether I have to map each folder or if there is a better way to handle this.  I can potentially convince management and clients to switch to a flat structure if I can make it have a similar look and feel, navigation, etc. 

 

Thank you for reading!!

1 ACCEPTED SOLUTION

Accepted Solutions

Hello @mdemarici 

Thank you for the information. Let me try and make it clearer.

I use a string variable to build the folder path, so after your trigger, initialize a variable to hold the folder path - initial value usually is the document library. See my screenshots below. I have included only the parts where I ensure that the folder path in which the document is to be moved, exists before the move file action.

MoveFileToTargetACustomer.png 

First part is to get the customer value from the file properties and add it to my folder path variable (TargetPath).

I then check to see if the folder exists already and if it does, I just continue, but if it does not exist then I create it.

 

The same I do with the file property Service ... add to variable, check that folder exists, create if not.

MoveFileToTargetBService.png

Do the same for all your properties/folder levels 😉

At last just use a Move file action to move your file from its path to the folder path variable.

Kind regards, John

View solution in original post

10 REPLIES 10
JohnAageAnderse
Memorable Member
Memorable Member

Hello @mdemarici 

I can't decide for you what you and your partners will do, but I can give a little information on how we are using Flow to move our documents around and the reason for it. Please note that we mostly are using Classic SharePoint still 🙂

 

In the beginning we had the Shared Documents library as a flat structure, no folders at all. At the same time we have a lot of different customers for which we need to have specific documentation. We were forced to include the customer name in the documents filename, so as not to have a conflict on naming.

 

We had already added several properties to the documents library - customer, service, tags. Also several content types were defined. As our colleagues works in teams and each teams provides support for one or more services, the above allowed us to create team pages and team customer pages which presented their customers and the documents related to customers and services - we introduced a minimal click solution for our teams - 1st click on customer, 2nd click on the document.

 

After some time, to avoid the filename conflict, we decided to introduce folders in the document library. We went with 3 levels, customer, service, content type. The introduction of folders had no impact on the presention in the team customer pages.

 

A flow was setup to automatically move a document into the correct folder based on the properties. By now having documents inside this folder structure, our colleagues can now name their documents without a customer name.

 

Hope the above gives you some ideas. Kind regards, John

Hi John, 

 

Thank you for taking the time to reply. I was able to get a flow going that moves the documents to a folder based on tags, any tips on moving the files to sub folders?

 

It sounds like our situations are similar. Us and our clients receive documents from a fairly large number of other companies. This semi large number of company names would be the names of the sub-folders. Do you have any insight as to how to write the flow to go to sub-folders? Do I have to write a condition for each company, or is there a way to do it with fewer conditions?

 

right now my flow is like this 

 

get created doc --> pull metadata --> if client abc, move to client abc folder 

 

What would be the best way to do this..

 

get created doc --> pull metadata --> if client abc, move to client abc folder --> move to company name folder within client abc folder

 

Thanks again for the help! @JohnAageAnderse 

Hello @mdemarici 

We use a known folder structure, so even when a new customer comes in or they start to receive a service, the flow will automatically create the needed folder structure.

The flow starts by building the folder path - first as just the customer name, checks that the folder exists, creates it if not - then takes the next level from the properties - service, adds it to the folder path, checks that the folder exists, creates it if not - and so on.

A document can end up in either the customer folder, the service folder or in the content type folder. The reason some documents ends up in the customer folder, is that they are not related to a service.

My best suggestion is for you to discuss your needed structure with your colleagues and then implement a solution for it.

Kind regards, John

Thank you, John. That description was very helpful to me!

Hi @JohnAageAnderse I'm trying to mimic your description, but I am unsuccessful. would you mind sending me a screenshot of how the flow starts by building the path?

 

Do you use the "create a new folder"  process?

Hello @mdemarici 

Thank you for the information. Let me try and make it clearer.

I use a string variable to build the folder path, so after your trigger, initialize a variable to hold the folder path - initial value usually is the document library. See my screenshots below. I have included only the parts where I ensure that the folder path in which the document is to be moved, exists before the move file action.

MoveFileToTargetACustomer.png 

First part is to get the customer value from the file properties and add it to my folder path variable (TargetPath).

I then check to see if the folder exists already and if it does, I just continue, but if it does not exist then I create it.

 

The same I do with the file property Service ... add to variable, check that folder exists, create if not.

MoveFileToTargetBService.png

Do the same for all your properties/folder levels 😉

At last just use a Move file action to move your file from its path to the folder path variable.

Kind regards, John

Hi @JohnAageAnderse 

Thank you for your continued support in this.

 

One quick question on the creation of the folder using the folder path string variable.

 

I'm getting an error that the folder name contains characters that are not supported when I use the folder path target variable in the create new folder step. Pic below. is there another way to use that variable in the create folder step so that it works?

 

 I also noticed in your pictures earlier, you used the get folder metadata using path step, I tried that and was also getting some errors as the target path was "not found" and for some reason, it didn't move onto the next step even when the "run after" said to move on whether it succeeds or fails

 

to understand this correctly, the target path is where the document needs to be added, the destination aka the customer folder, correct? if so, if it's not created yet, is the "get Folder metadata from the target path" step going to automatically fail, and that's why you have the "run after" step?

 

Thank you so much again, your last reply was a breakthrough for me and I feel like I am very close to solving this now. 

 

 

Hello @mdemarici 

Good to see that you are moving forward 🙂

 

About the folder path - yes, it must not contains any unsupported characters - you will have to look up what they are. I do change one character due to us having danish customers also and their name may have a slash "/" in it (a company type "A/S"), so we decided to just remove it.

 

The reason we are checking for the existence of a folder is that the customer may be new, or the service may be newly signed up to, so the folder may not yet exist.

 

By the way, in your condition it says "TargetPath contains TargetPath"?? It should be "<get folder meta data using path>Id is not equal to null (expression)" - testing if the action returned anything (old solution before Configure run after became available).

Kind regards, John

Thanks! @JohnAageAnderse 

 

Thanks for the clarification, so I have to change the characters inside the variable itself, the fact that im putting the variable in the folder path box isn't the issue? 

 

The if TargetPath contains TargetPath is actually TargetPath contains TargetPath2. I ended up making another variable that didn't have the customer name as a folder at the end because I was not sure why I was getting the error on the "Get folder Metadata using path" Step. it was saying it didn't exist. 

Was I running that step correctly? I was using the target path as the folder for the step. 

 

Thanks!

Hello @mdemarici 

The step Get folder metadata using path may succeed or may fail - the condition after checks to see if it was a success (Yes branch) or a failure (No branch).

Today with the features available, you actually don't need the condition, but can use a scope to hold the No branch steps and then configure the Scope to run only after a failure in the Get folder metadata using path step. (A future task for me to update our flow).

Kind regards, John

Helpful resources

Announcements

Community will be READ ONLY July 16th, 5p PDT -July 22nd

Dear Community Members,   We'd like to let you know of an upcoming change to the community platform: starting July 16th, the platform will transition to a READ ONLY mode until July 22nd.   During this period, members will not be able to Kudo, Comment, or Reply to any posts.   On July 22nd, please be on the lookout for a message sent to the email address registered on your community profile. This email is crucial as it will contain your unique code and link to register for the new platform encompassing all of the communities.   What to Expect in the New Community: A more unified experience where all products, including Power Apps, Power Automate, Copilot Studio, and Power Pages, will be accessible from one community.Community Blogs that you can syndicate and link to for automatic updates. We appreciate your understanding and cooperation during this transition. Stay tuned for the exciting new features and a seamless community experience ahead!

Summer of Solutions | Week 4 Results | Winners will be posted on July 24th

We are excited to announce the Summer of Solutions Challenge!    This challenge is kicking off on Monday, June 17th and will run for (4) weeks.  The challenge is open to all Power Platform (Power Apps, Power Automate, Copilot Studio & Power Pages) community members. We invite you to participate in a quest to provide solutions to as many questions as you can. Answers can be provided in all the communities.    Entry Period: This Challenge will consist of four weekly Entry Periods as follows (each an “Entry Period”)   - 12:00 a.m. PT on June 17, 2024 – 11:59 p.m. PT on June 23, 2024 - 12:00 a.m. PT on June 24, 2024 – 11:59 p.m. PT on June 30, 2024 - 12:00 a.m. PT on July 1, 2024 – 11:59 p.m. PT on July 7, 2024 - 12:00 a.m. PT on July 8, 2024 – 11:59 p.m. PT on July 14, 2024   Entries will be eligible for the Entry Period in which they are received and will not carryover to subsequent weekly entry periods.  You must enter into each weekly Entry Period separately.   How to Enter: We invite you to participate in a quest to provide "Accepted Solutions" to as many questions as you can. Answers can be provided in all the communities. Users must provide a solution which can be an “Accepted Solution” in the Forums in all of the communities and there are no limits to the number of “Accepted Solutions” that a member can provide for entries in this challenge, but each entry must be substantially unique and different.    Winner Selection and Prizes: At the end of each week, we will list the top ten (10) Community users which will consist of: 5 Community Members & 5 Super Users and they will advance to the final drawing. We will post each week in the News & Announcements the top 10 Solution providers.  At the end of the challenge, we will add all of the top 10 weekly names and enter them into a random drawing.  Then we will randomly select ten (10) winners (5 Community Members & 5 Super Users) from among all eligible entrants received across all weekly Entry Periods to receive the prize listed below. If a winner declines, we will draw again at random for the next winner.  A user will only be able to win once overall. If they are drawn multiple times, another user will be drawn at random.  Individuals will be contacted before the announcement with the opportunity to claim or deny the prize.  Once all of the winners have been notified, we will post in the News & Announcements of each community with the list of winners.   Each winner will receive one (1) Pass to the Power Platform Conference in Las Vegas, Sep. 18-20, 2024 ($1800 value). NOTE: Prize is for conference attendance only and any other costs such as airfare, lodging, transportation, and food are the sole responsibility of the winner. Tickets are not transferable to any other party or to next year’s event.   ** PLEASE SEE THE ATTACHED RULES for this CHALLENGE**   Week 1 Results: Congratulations to the Week 1 qualifiers, you are being entered in the random drawing that will take place at the end of the challenge.   Community MembersNumber SolutionsSuper UsersNumber Solutions Deenuji 9 @NathanAlvares24  17 @Anil_g  7 @ManishSolanki  13 @eetuRobo  5 @David_MA  10 @VishnuReddy1997  5 @SpongYe  9JhonatanOB19932 (tie) @Nived_Nambiar  8 @maltie  2 (tie)   @PA-Noob  2 (tie)   @LukeMcG  2 (tie)   @tgut03  2 (tie)       Week 2 Results: Congratulations to the Week 2 qualifiers, you are being entered in the random drawing that will take place at the end of the challenge. Week 2: Community MembersSolutionsSuper UsersSolutionsPower Automate  @Deenuji  12@ManishSolanki 19 @Anil_g  10 @NathanAlvares24  17 @VishnuReddy1997  6 @Expiscornovus  10 @Tjan  5 @Nived_Nambiar  10 @eetuRobo  3 @SudeepGhatakNZ 8     Week 3 Results: Congratulations to the Week 3 qualifiers, you are being entered in the random drawing that will take place at the end of the challenge. Week 3:Community MembersSolutionsSuper UsersSolutionsPower Automate Deenuji32ManishSolanki55VishnuReddy199724NathanAlvares2444Anil_g22SudeepGhatakNZ40eetuRobo18Nived_Nambiar28Tjan8David_MA22   Week 4 Results: Congratulations to the Week 4 qualifiers, you are being entered in the random drawing that will take place at the end of the challenge. Week 4:Community MembersSolutionsSuper UsersSolutionsPower Automate Deenuji11FLMike31Sayan11ManishSolanki16VishnuReddy199710creativeopinion14Akshansh-Sharma3SudeepGhatakNZ7claudiovc2CFernandes5 misc2Nived_Nambiar5 Usernametwice232rzaneti5 eetuRobo2   Anil_g2   SharonS2  

Check Out | 2024 Release Wave 2 Plans for Microsoft Dynamics 365 and Microsoft Power Platform

On July 16, 2024, we published the 2024 release wave 2 plans for Microsoft Dynamics 365 and Microsoft Power Platform. These plans are a compilation of the new capabilities planned to be released between October 2024 to March 2025. This release introduces a wealth of new features designed to enhance customer understanding and improve overall user experience, showcasing our dedication to driving digital transformation for our customers and partners.    The upcoming wave is centered around utilizing advanced AI and Microsoft Copilot technologies to enhance user productivity and streamline operations across diverse business applications. These enhancements include intelligent automation, AI-powered insights, and immersive user experiences that are designed to break down barriers between data, insights, and individuals. Watch a summary of the release highlights.    Discover the latest features that empower organizations to operate more efficiently and adaptively. From AI-driven sales insights and customer service enhancements to predictive analytics in supply chain management and autonomous financial processes, the new capabilities enable businesses to proactively address challenges and capitalize on opportunities.    

Updates to Transitions in the Power Platform Communities

We're embarking on a journey to enhance your experience by transitioning to a new community platform. Our team has been diligently working to create a fresh community site, leveraging the very Dynamics 365 and Power Platform tools our community advocates for.  We started this journey with transitioning Copilot Studio forums and blogs in June. The move marks the beginning of a new chapter, and we're eager for you to be a part of it. The rest of the Power Platform product sites will be moving over this summer.   Stay tuned for more updates as we get closer to the launch. We can't wait to welcome you to our new community space, designed with you in mind. Let's connect, learn, and grow together.   Here's to new beginnings and endless possibilities!   If you have any questions, observations or concerns throughout this process please go to https://aka.ms/PPCommSupport.   To stay up to date on the latest details of this migration and other important Community updates subscribe to our News and Announcements forums: Copilot Studio, Power Apps, Power Automate, Power Pages

Users online (841)