Parsing Data

I often need to parse data within ProcessFlow or Design Studio and thought I'd share some quick tips on parsing text using JavaScript.

If I have a variable called mytext with the value of "David's Blog" and only want to use part of the value I can parse it.

mytext.substring(0,4) would return "David"
Substring returns the text between two points so to get the value substring starts at the 1st position (JavaScript starts with 0, not 1) and ends with the 2nd position.

mytext.substr(0,5) would return "David"
Substr returns the text from the starting point and forward the number of characters specified. If you leave the 2nd position off the substr command it will parse the text to the end point.

mytext.indexOf("Blog") would return 8
The indexOf method searches for your quoted value and returns the starting point of that value within the text.

mytext.length would return 12
The length method returns the number of characters (including spaces) within your text. This method doesn't start with zero so you get the actual number of characters.

You can use these methods together:

mytext.substr(mytext.indexOf("'s"),5) would return "'s Bl"

ProcessFlow User Level Work

Recently on John Henley's Lawson Guru Forum another contributor suggested assigning UserAction approvals to the User rather than to the Task. Normally the User Level Work Inbasket is used with HRUserAction approvals so why not assign non-HR approvals to Users as well?

The only real objection I have to this is that when a user leaves then the flow file would have to be updated rather than updating the ProcessFlow Admin User setup forms. When you update the User Task then the new user will see the existing Inbasket tasks right away - but if existing WorkUnits are assigned to Users they will have to be reassigned.

Either way there is some maintenance but I think updating the User Task is much easier and I would recommend keeping it simple.