03-13-2017 01:41 PM
Hello all, I am on OnBase 13 and attempting to clean up some legacy data. In our environment, for quite some time, the Name keyword has been used for both Last Name and Full Name.
I'm looking to attempt to rectify that and go backwards and correct the documents in our system this way. I'm guessing the len property in Core based Workflow is probably my best bet to accomplish this.
However, I'm not sure I grasp how to use it to show the length for multiple instances of the same exact keyword on a document.
I was planning on using the len function to determine the length of each instance of the Name keyword and then later on copying that to the Last Name field and leaving Name with the longer length.
Once the legacy items are cleared up, I plan on using Autofill Keyword Sets going forward.
I'm not very familiar with scripting at this point, but realize this would be very beneficial in determining a solution.
Thank you in advance for any help or suggestions,
Stephen
03-14-2017 11:46 AM
Splitting Full Name into first and last name is usually strait forward. The biggest issue is determining if there are special characters or multiple names. If you know for a fact that all Full Names only follow the format of "FIRST LAST" then the following solves it...
The function of InStr() is useful for finding characters.
For example InStr("Stephen Dignam";" ") will result in 7 (the location of the space from the left starting with a count of 0)
Next, the function of Left() can be used to extract the First Name to that point. The combined functions would look like:
Left(%K<full name keyword here>;InSTR(%V<full name keyword here>;" "))
so
propFirsttName = Left("Stephen Dignam";InSTR("Stephen Dignam";" "))
returns
propFirstName = Stephen
After that we can get the Last Name in a few ways.
The Mid() function can be used with the previous InStr() trick or you can simply use a Replace() function.
Replace Example-
propLastName = Replace(%VPropFullName;%VPropFirstName+" ";"";true)
propLastName = Replace("Stephen Dignam";"Stephen"+" ";"";true)
results in
propLastName = "Dignam"
Mid Example (this one requires much more work)-
Mid(%VPropFullName;
InSTR(%VPropFullName;" ")+1;
LEN(%VPropFullName)-InSTR(%VPropFullName;" ")
)
---------------
Your biggest challenge will be for all the names that don't match the pattern of First Last. Here are some variances examples that I have encountered:
In each of these cases you would need to use InStr(), Count(), Replace() or IsMatch() to trap the pattern and then decide how to deal with the exception.
Here is a property expression that will count the number of words based on spaces (it uses the Replace function to remove anything that is not a Space character then counts only the spaces; you have to add one as it starts the count at 0)
LEN(Replace(%VpropFullName;"[^\s]";"";true))+1
I always liked Miguel Z's recommendation to focus on automating exceptions that occur 80%+ of the time, and then send the lesser exceptions to a lifecycle or queue for a person to review.
03-14-2017 12:43 PM
You mention using an AutoFill to address new documents going forward. If the existing documents already have the primary key assigned to them, you could use the Keyword Updater to replace the Name keyword(s) - potentially eliminating all exceptions.
03-13-2017 02:06 PM
03-14-2017 09:24 AM
03-14-2017 11:46 AM
Splitting Full Name into first and last name is usually strait forward. The biggest issue is determining if there are special characters or multiple names. If you know for a fact that all Full Names only follow the format of "FIRST LAST" then the following solves it...
The function of InStr() is useful for finding characters.
For example InStr("Stephen Dignam";" ") will result in 7 (the location of the space from the left starting with a count of 0)
Next, the function of Left() can be used to extract the First Name to that point. The combined functions would look like:
Left(%K<full name keyword here>;InSTR(%V<full name keyword here>;" "))
so
propFirsttName = Left("Stephen Dignam";InSTR("Stephen Dignam";" "))
returns
propFirstName = Stephen
After that we can get the Last Name in a few ways.
The Mid() function can be used with the previous InStr() trick or you can simply use a Replace() function.
Replace Example-
propLastName = Replace(%VPropFullName;%VPropFirstName+" ";"";true)
propLastName = Replace("Stephen Dignam";"Stephen"+" ";"";true)
results in
propLastName = "Dignam"
Mid Example (this one requires much more work)-
Mid(%VPropFullName;
InSTR(%VPropFullName;" ")+1;
LEN(%VPropFullName)-InSTR(%VPropFullName;" ")
)
---------------
Your biggest challenge will be for all the names that don't match the pattern of First Last. Here are some variances examples that I have encountered:
In each of these cases you would need to use InStr(), Count(), Replace() or IsMatch() to trap the pattern and then decide how to deal with the exception.
Here is a property expression that will count the number of words based on spaces (it uses the Replace function to remove anything that is not a Space character then counts only the spaces; you have to add one as it starts the count at 0)
LEN(Replace(%VpropFullName;"[^\s]";"";true))+1
I always liked Miguel Z's recommendation to focus on automating exceptions that occur 80%+ of the time, and then send the lesser exceptions to a lifecycle or queue for a person to review.
03-14-2017 12:41 PM
Find what you came for
We want to make your experience in Hyland Connect as valuable as possible, so we put together some helpful links.