Jan 04 2024 01:06 PM - edited Jan 04 2024 01:12 PM
Hi, this seems like it should be pretty straight forward to me, but I can't seem to figure it out with the newest GUI of PowerAutomate Flow.
How can I copy a file from one site to another SP site (to a certain folder) when a specific metadata tag is used? e.g., I want to copy a file from SP Site #1 when this "Closeout - As-Builts" tag is used to SP Site #2 to Subfolder #1
Another portion of my question would be, is it possible to have the flow look across ALL of our sites that have a "Construction & Development" library for this specification? Or do I need to create a separate flow for all 20 of our Property sites for this to work?
Thank you in advance!
Morghan C.
Jan 05 2024 12:45 AM
Hi @mdcastorena , if consolidating to a single site and document library isn't possible you could consider a basic Flow on each which updates a central list with and changes from across all sites. The simple Flows would update the list with the source site detail, document detail and the change. Then, a single 'master' Flow would monitor changes to the list and evaluate the change in the Document Type attribute. If it meets your criteria it would then use the list metadata to move the file to the correct location.
I haven't built an example but that is how I might first approach the problem.
Jan 05 2024 03:11 PM
Hi @Jon_Lake - thank you for the response.
I think I need more help with the first question before being able to wrap my mind around automating it across all sites.
With that said, let me ask the question this way -
I upload Test File to Doc Lib 1 on Site 1 which is using Content Type "Document Type" in column 2.
I want to take any file uploaded and tagged as "Closeout - As-Builts" to Doc Lib 2 on Site 2.
Doc Lib 2 on Site 2 is NOT using content types (we don't need them - we just want the document copied over). Screenshots below --
Doc 1 Site 1 on the left. When file is uploaded, and Document Type "Closeout - As-Builts" is applied, copy to Doc 2 on Site 2:
I tested by clicking Upload > Files from Doc Lib 1 Site 1:
I upload "Test Doc 6.docx" to Doc Lib 1 to Site 1 and apply the Document Type (Content Type) "Closeout - As-Builts":
However, when I run a test with my flow, I get a message that the condition has not been met:
For reference, here is what I have so far in my Flow... I must not be doing something right:
Jan 06 2024 03:07 AM
Hi @mdcastorena , I set up a test source folder and destination folder. I set my document type attribute using a choice field but that's not a requirement. It looked like this for the sake of testing.
I then use the 'Move file' action in the yes path of my condition. In testing it successfully moves the two qualifying files.
The files move with their attributes. I didn't create the document_type field in the destination folder, it was created automatically.
Jan 08 2024 11:30 AM
Hi @Jon_Lake -
Thank you for the response! I want to keep the original file in Doc Lib 1 Site 1 and just copy the file to Doc lib 2 Site 2. Is that possible? Does your test keep the original file in it's source lib?
Jan 08 2024 11:59 PM
Hi @mdcastorena , yes you can copy the file rather than move it.
Jan 10 2024 10:48 AM
Hi @Jon_Lake - Can you please explain what Dynamic Content you're using in the first two steps (before the "For Each" step)? That is where I am getting stuck now (also, can you confirm I am using the correct trigger and Get File action? Sorry for so many questions; it has been a very long time since I've worked with Flow):
Thank you for your assistance!
Jan 12 2024 07:53 AM
Hi @mdcastorena , I simplified the Flow. If I update the document attribute accordingly it works well.