copy folder with content to other library

by Dave Bakker » Mon Nov 24, 2014 10:24 pm

I would like to have some advice about the following:

I have a site with 5 libraries.
In one library I make folders in wich I put documents.
Now I want to create a workflow that copies the folder with content to the other 4 libraries by manual action. I did try to create a workflow as described in the manuel with the example, but I cannot get it to work. I hope you can give me some directions.
Dave Bakker
 
Posts: 4
Joined: Mon Nov 24, 2014 10:18 pm

by Anton Khritonenkov » Tue Nov 25, 2014 9:18 am

Hi Dave,

You can use Copy Folder from Library workflow action. You need to specify 'SourceUrl' property. For example '[%Workflow Context:Current Site URL%]SiteUrl/LibraryName/FolderPath'. Then 'TargetListUrl' as URL of target document library. For example '[%Workflow Context:Current Site URL%]SiteUrl/LibraryName/'. Then specify 'TargetPath' as path related to target library, for example '/FolderName1/FolderName2'. Thus, folder will be moved to '[%Workflow Context:Current Site URL%]SiteUrl/LibraryName/FolderName1/FolderName2'.

Do not forget to specify AdminLogin and AdminPassword of an account which has permissions to both source and target libraries.

If this doesn't work for you, could you attach a screenshot of your workflow (without sensitive data) and a screenshot of an error as reply to this post?
User avatar
Anton Khritonenkov
 
Posts: 216
Joined: Wed Nov 12, 2014 1:33 pm

by Dave Bakker » Wed Nov 26, 2014 8:59 pm

Hello Anton,

Thank you for your help.

I somehow managed to copy the content of the source folder to a destionation folder.
The only thing that is missing, is the folder itself. I have included a screenshot of my workflow

I want to copy a folder with content from library A to library B, not only the content of the source folder.
I hope you can help.

Thanks in advance.

https://onedrive.live.com/?cid=C3AD0FFFB76F70A3&id=C3AD0FFFB76F70A3%2179701&v=3
Dave Bakker
 
Posts: 4
Joined: Mon Nov 24, 2014 10:18 pm

by Anton Khritonenkov » Thu Nov 27, 2014 1:50 pm

Hi Dave,

I see 'This item might not exist' when navigating to your onedrive. This forum supports attachments. You can attach images to your reply.

Regarding your question. Ensure that you specified URL of target folder including name of the folder you are trying to copy. For example you have folder /Folder1/SubFolder1, you need to specify the same path for destination URL /Folder1/SubFolder1. Actually you can specify any other name, for example /Folder1/AnotherFolderName. The workflow action will create appropriate folder. Thus, you can rename folder while copying.
User avatar
Anton Khritonenkov
 
Posts: 216
Joined: Wed Nov 12, 2014 1:33 pm

by Dave Bakker » Thu Nov 27, 2014 9:20 pm

Hello Anton,

I got it work as you descibed it.
So I made in the source library a folder called: meetings.
In the target library I also created a folder called meetings.
This is the destionation folder in the workflow.
As I add a new folder to the source folder meetings and start the workflow, it is being copied to the target folder. As I add another this is also copied including all the files.

But this only works for the 'main' source folder called: meetings.
All the content in the folder is being copied and overwrites the existing files.
I want to achive that I create a personal meeting library of documents so that the user can annotate them. The meeting documents are grouped by folder.
My current workflow 'overwrites' every existing document so the personal annotations are gone from previous meetings.

So my questions are:
1. Can I instead of copying everything, only contribute newer subfolders and files to the target folder?
or
2. Is there any other way to simply copy a folder with a custom name from the 'root' of the source document libray to the 'root' of destination library?

Regards,
Dave

UPDATE: I have found a solution. The account that is used in the workflow for copying the files should be set with a permission level of only read and contribute files and not edit. Now it will not overwrite exisiting files that have been edited.
Dave Bakker
 
Posts: 4
Joined: Mon Nov 24, 2014 10:18 pm

by Anton Khritonenkov » Fri Nov 28, 2014 7:52 am

Hi Dave,

Thank you for sharing your solution.

We will consider your case and possibly add new option 'Override' to the workflow action in future releases.

I'm not sure, I understood this your question correctly:
Is there any other way to simply copy a folder with a custom name from the 'root' of the source document libray to the 'root' of destination library?


You can specify any name for destination folder. Thus, the folder will be renamed while copying and it will not override the older folder, just create the new one with new name, for example FolderName_CurrentDate.
User avatar
Anton Khritonenkov
 
Posts: 216
Joined: Wed Nov 12, 2014 1:33 pm


Return to Workflow Actions Pack for Office 365