Fairly new to PA...
I am trying to create a flow that will move files from a site collection to another while preserving the folder structure (e.g. Shared Documents/Folder/Folder/File). Both site collections have the same folder structure.
I created the following workflow, but the problem is that if I filter the query (ContentType ne 'Folder')
by trying to pull only documents (docx, xlsx, pdf, pptx) it will only move the pdfs.
Any ideas?
Solved! Go to Solution.
Hi @XAEA12,
You could use Copy Folder action, it will preserve files and folder structure:
Best Regards,
Community Support Team _ Lin Tu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Weird!
@XAEA12 (nice name) I made a test on my end, with the same Odata query filter, but I am just using the out of the box "Move File" action, instead of the Send an HTTP request action and it works fine.
It moved all of my documents (including PDFs, .docx, .xlsx, .ppt and even .url) but it left the folders. Is there any reason you need the HTTP request action?
Is this for archiving? Is that the purpose of the Flow? - asking because I am working on similar ideas for archiving/publishing to intranet sites etc.
Hi @XAEA12,
You could use Copy Folder action, it will preserve files and folder structure:
Best Regards,
Community Support Team _ Lin Tu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
@v-litu-msft , but will that keep the version history?
Seems like OP wants to keep the version history, and Copy File (not sure about folder) does not keep it as far as I know.
Yes, the end goal would be to have an archiving solution, on the site level.
Indeed, it's curious that the api won't work as expected, I thought that it's a bit more flexible.
I used the Move file, but had to adapt the dynamic content output as the FolderPath from Get Files(Properties only) looks like: Shared Documents/ Folder/ but the move requires the path: /Shared Documents/Folder.
Like this it works as it picks up even Shared Documents/Folder/Folder/Folder/File
Hi @XAEA12 @SylvieLet17 ,
The copied files couldn't the original version, the version history only keep when these files are moved to some folders:
https://www.cognillo.com/blog/copy-a-list-in-sharepoint-or-office-365/
Best Regards,
Community Support Team _ Lin Tu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.