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

Question

Question

Copy metadata from parent folder to subfolder

asked on October 8, 2017

I have a client who wants all metadata from a parent folder added to all subsequent subfolders and documents within the parent folder.

 

The current folder structure is Projects\Project files\(parent folder here)\(subfolders with document contents)

 

Within Project Files, there are over 3000 main folders that hold the current metadata. These folders, and the subfolders within, are created by a workflow that pulls the data from a website. Although this workflow applies a template to the parent folder and assigns the metadata there, this doesn't carry on over to all the subfolders.

 

I've been trying to create a workflow that will pull the metadata from the parent folder and apply it to the subfolders. I've been playing around with a few iterations of Retrieve/Assign Field Values, Copy Metadata and Patternmatching, but I haven't had any success yet.

0 0

Replies

replied on October 9, 2017

Are you talking about a one-time "catch-up" workflow for what it out there, an ongoing workflow to catch all new subfolders and documents, or both.

 

Workflow has a Copy Metadata activity.  For example, you would find the subfolder you want to put the metadata on and use the copy metadata activity to copy from the parent folder to the subfolder.

 

After doing the subfolders, you could find all the documents in a subfolder and use the copy metadata activity from the subfolder to the document.

 

 

CopyMetadata.jpg
CopyMetadata.jpg (66.15 KB)
2 0
replied on October 10, 2017

This would be a one-off workflow initially, and then I'd be looking to set it up as a condition for each time a new folder is uploaded to this path.

 

The particular issue I'm encountering is that each parent entry contains 5 or 6 subfolders. I want to target the subfolders, which will have the metadata applied to them.

 

I've been using the Copy Metadata action, but I'm not sure how to best tell it where to copy to.

0 0
replied on October 10, 2017

You need to perform a search in the WF, and use a for each entry loop to iterate through the folder results and use the copy metadata action within the for each entry loop to assign the metadata.

0 0
replied on October 10, 2017

That is in essence what I'm trying to do.  Unfortunately it doesn't carry the template across to the subfolder entries, and it's actually removing the metadata (and template) from the parent folder when I'm doing tests. The opposite of what I actually want!

metadata test.png
0 0
replied on October 10, 2017

You need to make the copy metadata activity use the current entry iteration within the for each entry loop

0 0
replied on October 12, 2017

Unfortunately that doesn't work either.

My current testing environment has the following tree:
 

  • !!!Workflow Testing
    • Testing Folder 001
      • 123
      • 456
      • 789
    • Testing Folder 002
      • abc
      • def
      • ghi

 

Testing Folder 001 and Testing Folder 002 have the necessary metadata. I want to apply this metadata (and template) to the subfolders (123 &c. and abc &c.). The metadata is instead being applied to !!!Workflow Testing.

0 0
replied on October 13, 2017

The one off workflow that updates all existing entries is described here.

0 0
replied on October 15, 2017

That's invoking another workflow, though, right?

0 0
replied on October 16, 2017

It's a workflow that invokes itself as needed.

0 0
replied on October 16, 2017

In that case, it doesn't really help what I'm trying to do.

0 0
replied on October 17, 2017

Why not?

0 0
replied on October 17, 2017

Calling on another workflow isn't a problem - it's that I don't have another workflow for it to call on.

 

The current workflow that is used to create the folders and fill in the parent folder metadata is referring back to a website. The metadata is pulled with JSON, which assigns token values (among other things, such as assigning access rights and the like). As such, this particular workflow won't be suitable to call on.

0 0
replied on October 18, 2017

I was going off your reply  to Jennifer's question on whether you need a one time "catch-up" workflow to update existing folders. The thread I linked to is the one-off workflow that will get the existing folders updated with their parent metadata.

The on-going one would be triggered on document or folder creation and it would only contain a Find Entry set to "Entry Path" (in order to find the parent) and a Copy Metadata from the found entry to the starting entry. Since this would run whenever a document or folder is created, you don't have to worry about subfolders because their parent would already have the right metadata.

 

0 0
replied on October 9, 2017

Hi Ramon,

 

You should be able to do this pretty simply using a search repository task, for any folder name (just use a * and folder) then perform a for each entry activity and insert the metadata from the starting entry into each iteration?

 

Or am I missing something?

 

Cheers!

0 0
replied on October 13, 2017

Did you double check which entry you are copying from and which one you are copying to?  It sounds like they might be backwards.

0 0
replied on October 15, 2017

I've tried a number of variants, but nothing seems to be able to target the subfolders.

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

Sign in to reply to this post.