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

Question

Question

Testing Length of Entry Name for Conditionals

asked on April 11, 2023

Over the years our County has changed the way they record official documents and the numbering systems and the way they indicated these on the document itself.  Unfortunately, previous staff have followed short-hand for the naming of these documents.  5 and 6 length documents were added during a set period of years (what I am calling an era) and then 6 and 7 length names were set for a different set.  They are all stored in the repository under each year, so I can manually run the workflow for each era to maintain track of which documents have been renamed.

I need to write a workflow to change the Entry name from the short-hand way to the actual name as the County (called a Reception #).  I am struggling with how to do the following Conditional tests:

1) If the length of the Entry Name is 5 characters, leave it alone...it is an error and must be manually rectified. (I will probably test for this and set a flag to easily find them later).

2) If the length of the Entry Name is 6 characters, add the 4 char Year field to the entry name and re-save with the new name

3) If the length of the Entry Name is 7 or more characters, or has an F character in space one, leave it alone. It is valid and correct.

I was thinking that a regular expression may get me what I need, but they are not my strong point, yet.

0 0

Replies

replied on April 11, 2023 Show version history

I would use a "Token Calculator" activity with the "StringLength" (LEN) formula to determine the length of the entry name.

Then based on that result, I would use a "Conditional Decision" Activity to dictate what to do if the result was 5 or less, if it was 6, or if it was 7 or more.

0 0
replied on April 11, 2023

I will try that!  Seems simpler and easier.  Thanks!

 

0 0
replied on April 11, 2023 Show version history

I wouldn't do it like this because of the potentially large number of entries to process. If most of your docs have 7-character names, that's could be a lot of entries you retrieve and then basically throw away.

I would have a workflow that searches for documents with a 6-char name. You can use {LF:Name="??????", Type="D"} in your search criteria and combine it with a folder path  search or something that would narrow down further if possible.

 

3 0
replied on April 11, 2023

That is a very good point @████████- I was assuming a workflow that was looking at a single entry - but if the workflow is looking at hundreds of thousands of entries (or more) - my suggestion is not an efficient one.

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

Sign in to reply to this post.