Metadata Syncing Template
This workflow runs when fields or tags change on an entry. If the metadata changes on a folder, the metadata on all the documents in that folder will be updated to match. If the metadata changes on a document, the metadata for that document’s folder and all the other documents in that folder will be updated to match. This workflow automatically ensures metadata remains consistent so users can be confident the metadata on whatever entry they are looking at is up to date.
How it works
A Conditional Decision activity defines two possible courses of action depending on if the entry is a document or folder.
- If the entry is a document,
- The document’s folder is found and metadata is copied from the document to the folder.
- A Find Entries activity finds all the documents in that document’s folder.
- For each document found, metadata is copied from the starting entry (the document whose metadata changed initially) to the document currently being processed by the For Each File activity.
- If the entry is a folder,
- A Find Entries activity finds all the documents in the folder.
- For each entry found, it copies the metadata from the starting entry (the folder whose metadata changed initially) to the document.
Note: Because no condition is specified on the “Entry is a folder” branch of the Routing Decision activity, that branch will act as an exception branch and will run if the entry is not a document. Since the starting rule specifies the entry must be a folder or document, the “Entry is a folder” branch should only process folders. If you edit this workflow to run on other types of entries, you will need to update these conditions, and potentially add an exception branch to the activity.
To run this workflow template in the provided test environment
Important: Ensure your Workflow user (the user specified in your connection profile) is excluded in the starting rule for this workflow before you run it. The condition should read: User does not equal insert your Workflow user, and the rule should be republished after the condition is added. Otherwise, the workflow will start itself continuously, quickly slowing your Workflow Server.
Why? The workflow will start itself because the workflow starts when metadata is changed. When the workflow synchs the metadata, it makes additional changes to the metadata, which in turn satisfy the starting rule, starting the workflow again. If you exclude the Workflow user, changes the workflows makes to the metadata will be ignored, and the workflow will only run when a user changes the metadata.
Note: To start the workflow, you must be logged into the client as someone other than the Workflow user, or else the workflow will ignore your actions.
- Ensure the workflow’s starting rule is enabled in the Workflow Rule Manager.
- In the Client or Web Access, set or delete a field or tag on a document or folder in the \Workflow Templates - Test Entries\Sales\ Contracts folder.
- Check the metadata to see that it’s been updated/synced.
Alternatively, you can test the workflow (bypassing the starting rule) with the Run Current Workflow option in the Workflow Designer. Test this workflow on the Letter About Additional Services document in the \Workflow Templates - Test Entries\Sales\ Contracts\Company EFG folder and watch its metadata be copied to the other entries in the folder and to the folder itself.
Ideas to expand this workflow
If you do not want metadata changes to documents to affect the metadata on the folder or other documents, delete the first branch in the Routing Decision activity.
The template is only configured to interact with documents and folders. If you want to sync record series, shortcuts, and subfolders, change the starting rule conditions for the workflow and/or the options in the Find Entries activities’ Filter Entries property boxes to account for those entry types. Additionally, edit the conditions in the Routing Decision activity to account for these other entry types.
Remember to republish the workflow after making any changes.