You are viewing limited content. For full access, please sign in.

Question

Question

Merging Duplicate Folders

asked on January 14, 2014

I have duplicate named folders.   The duplicated folders end in a (2).  Is there a way to merge these folders using WF?

 

If not, how could I set up a WF to move the entries found in the *(2) folder to the main folder?  Once the entries are moved, I could then manually go and delete all the folders ending in (2) as a batch.

 

0 0

Answer

APPROVED ANSWER
replied on January 14, 2014

Sorry, I didn't mean to sound condescending, i was just answering your initial question. The workflow below trims the (N) from the end of the path, moves the entry to the correct path then attempts to delete the original folder (if it is empty).

 

I've tried it out with a starting rule set to for entry creation with conditions on the entry being a document and the path matching regular expression \s+\(\d+\)$ (ie, "ends with (N)"). The same idea is used in pattern matching in the WF itself to trim the number at the end (the regular expression looks for "everything but the number at the end").

 

Depending on how your documents land in these folders, you may need to tweak the starting rule a bit or add separate rules for entry moved and entry copied events.

 

2 0
replied on January 15, 2014

You can also create it as a business process and manually trigger it when you find a folder that fits your circumstances.

0 0

Replies

replied on January 14, 2014

I agree.  It should be straightforward, but it's not.  Your response doesn't really provide any help.  If this is not the place to ask these types of questions, then please let me know and I will email Presales directly.

 

Thank you!

 

1 0
replied on January 14, 2014

It should be pretty straightforward to set a workflow that checks the folder name and if it ends in (N​), then find its child entries and move them to the path without the trailing number.

0 0
replied on January 15, 2014

An important aspect no covered yet in this post is folder access rights. Merging should ***not*** take place when folders' access rights differ. And similarly for folders volume.

 

Few thoughts to make things less straightforward ;-)

0 0
replied on January 15, 2014

Currently there is no ability to check access rights on an entry without the use of a custom Script. This is not part of the initial questions but a very important consideration for some companies to be aware of if it's needed. I think it's fair to assume in this example that we have folders generated that inherit the rights from the parent folder/are the same as the other numbered folders as they are all meant to be used the same.

 

Kristina,

 

Look at the slightly less dark text underneath the activities. Miruna has done a fairly great job adding into the comments the information you seek in setting up the workflow like she has laid out. 

 

What the workflow Miruna is suggesting does is do a pattern match on the Entries path, to find the new path that you want to move the documents in. The starting Entry is any document inside a folder with a number at the end, or rather, you can publish the workflow and select the "Play" looking button in the top toolbar and select it to run on a folder and check the option for it to run on each entry that is in the folder. (Or set a similar rule in the Rule Manager).

 

After it has done the Pattern matching, you have a token with your new filepath. What you do from there is move this entry to its new filepath. 

 

Then you need to get rid of this potentially empty folder, but we need two activities for that. The first being to find the entries original folder using the "Find Parent Folder" activity. 

 

Once we have that, we can use the "Delete Entry" activity to clean up the repository, but setting the option for only deleting folders when they are empty will ensure we do not get rid of anything we shouldn't be deleting. 

 

If this is not clear at this point, I hope you can explain to us what is unclear so we can make sure to address that for you.

 

0 0
You are not allowed to follow up in this post.

Sign in to reply to this post.