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

Question

Question

Rename all files specified in a LF Repository Folder based on Metadata

asked on April 10

I have a folder structure where all of the files have consistent metadata with them and staff is willing to update any missing metadata before we start this project. There are 100s of documents that are inconsistent with naming so I want to run a workflow a couple of different ways:

1. run one time to fix the names

2. set a workflow to run when that template is used and rename the file

Currently this template has it's own workflow that does the filing... puts on the backend because we use archiving and creates a shortcut on the front end... this works great, but there hasn't been any standardized naming conventions for several years.

We do have other workflows that do a rename and file all at the same time and have 2 different run's scheduled, one is upon creation and the other is upon a change, I can probably use those as examples to integrate whatever I do here.

I got this far but am stuck:

I'm sure here is part of my issue, I copied this from another source so this sql table is probably totally irrelevant to what I am trying to do:

I'd like to do some kind of metadata token/query type of thing to name the files that currently exist.

0 0

Answer

SELECTED ANSWER
replied one day ago

Do you have an example? You should be able to do this within the workflow simply using the token editor rather than referencing a spreadsheet.

To make this more reusable, I advise you to split this into two workflows.

  1. Run one time on multiple entries to fix names: This does not have a starting entry. Replace the "Find Entry" activity with the "Search Repository" activity to find all of the entries within your Testing Folder. Then, for each entry, run the "Invoke Workflow" activity for the below workflow. You may want to check the "Wait for Invoked Workflow" option to prevent too many instances running at the same time.
  2. Run when that template is used and rename the file: This has a starting entry. Here is where you'd run the "Retrieve Field Values" activity on the starting entry to get the metadata fields for renaming. Other thoughts:
    1. Add a "Conditional Sequence" activity to only rename the entry if it needs to be renamed (example: If Entry:Name (Workflow::Starting Entry) does not equal %(NewName)).
    2. Add a "Retrieve Shortcuts" activity to locate any shortcuts to see if they need to be renamed.
    3. Add a "Conditional Sequence" activity to rename the shortcuts if they are found and incorrectly named.

 

With this approach, you only ever use the second workflow to perform the actual renaming, so you don't have to maintain two completely separate workflows that are supposed to essentially do the same thing.

0 0

Replies

replied on April 11

Hi Tracey,

I might be oversimplifying this, but if you want to use document metadata to rename these documents, something like this should work:

It's similar to what you posted in that you still have to find the entries you want to rename, and you still have to use a For Each Entry loop, but within the loop, I just have a Retrieve Field Values activity to get the field values to use in the document name, and then a Rename Entry activity in which I can use the token values from the Retrieve Field Values activity.

You mentioned you have the actual document itself in one folder, and then there's shortcuts to these documents elsewhere. I don't think the names of the shortcuts will update automatically. If they don't, you could probably use a workflow like this one, but configure the Find Entries activity to find the shortcuts instead.

Does that help at all? This kind of activity sequence can be used when a document is created or changed, too, like you mentioned.

1 0
replied one day ago

This was definitely on the right track, however, I should have been more focused on using the metadata to do this rename vs this spreadsheet approach, which WOULD have worked. I will come back here to post how the new workflow was structured to do the rename.

0 0
replied on April 10

Update: I can tell by the workflow I copied from, they built a table of what the file name was and what they wanted to name it to. I can build this in excel by using concat of the downloaded metadata which I will start now just for the sake of the exercise. But, if there is an easier way to accomplish this I would love to know!

0 0
SELECTED ANSWER
replied one day ago

Do you have an example? You should be able to do this within the workflow simply using the token editor rather than referencing a spreadsheet.

To make this more reusable, I advise you to split this into two workflows.

  1. Run one time on multiple entries to fix names: This does not have a starting entry. Replace the "Find Entry" activity with the "Search Repository" activity to find all of the entries within your Testing Folder. Then, for each entry, run the "Invoke Workflow" activity for the below workflow. You may want to check the "Wait for Invoked Workflow" option to prevent too many instances running at the same time.
  2. Run when that template is used and rename the file: This has a starting entry. Here is where you'd run the "Retrieve Field Values" activity on the starting entry to get the metadata fields for renaming. Other thoughts:
    1. Add a "Conditional Sequence" activity to only rename the entry if it needs to be renamed (example: If Entry:Name (Workflow::Starting Entry) does not equal %(NewName)).
    2. Add a "Retrieve Shortcuts" activity to locate any shortcuts to see if they need to be renamed.
    3. Add a "Conditional Sequence" activity to rename the shortcuts if they are found and incorrectly named.

 

With this approach, you only ever use the second workflow to perform the actual renaming, so you don't have to maintain two completely separate workflows that are supposed to essentially do the same thing.

0 0
replied one day ago

Hey Kevin! I ended up reaching out to our VAR for assistance on this and they indeed did end up having me write a workflow that does the rename but based more like what you describe in #2 above and it works great!!! I am still tweaking it a bit but will publish here what I ended up doing! Thank you!

0 0
replied on April 11

I tend to over complicate things! This looks good! I will try it today and let you know! I think I was missing the retrieve field values task because I couldn’t figure out how to find the template and choose the metadata.

Also, I think I’ll have to do a similar task as our other change workflows for the shortcuts. It does something like … if shortcut exists, delete it, then create it. I’ll find examples of that.

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

Sign in to reply to this post.