Manage Learn to apply best practices and optimize your operations.

Extract value pairs from text arrays with LotusScript

Use this LotusScript code to extract value pairs from a text array. In this example, see how various Work Flow status stages were extracted and summarized, allowing the results to be more easily analyzed.

A client recently asked me to compose a system for extracting value pairs from text arrays so the company could analyze the amount of time Lotus Notes documents spent in various Work Flow status stages. They thought this method would help to better analyze the results.

Related resources from SearchDomino.com:
Mass-input form uses LotusScript to ease large-scale moves

Code exports Lotus Notes data to an OpenOffice Calc spreadsheet

Code a stack trace into LotusScript libraries for error handling

However, because the status history was only available in a text array, there was a problem. The Lotus Notes documents could spend an undetermined amount of time in any status more than one time. The variety and number of status stages precluded the use of multiple-type double variables. The status stages also held time values.

This addition of new status stages meant that I would also need to rewrite the LotusScript code. Because most documents used just five or six of the 16+ available statuses, that would waste too much time and the code would be extremely complicated.

Here is a sample of the text array:

Example of text array
(Click on code for enlarged view.)

The solution was to extract the data into a list using the status as the list tag:

LotusScript to summarize results
(Click on code for enlarged view and script download.)

This method did everything the client wanted -- quickly and accurately. Additionally, because I only used 22 lines of code, it's easy to understand and debug.

Combination of text array and LotusScript code
(Click on code for enlarged view and script download.)

Do you have comments on this tip? Let us know.

This tip was submitted to the SearchDomino.com tip library by member Jack Swalwell. Please let others know how useful it is via the rating scale below. Do you have a useful Lotus Notes/Domino technical tip or code snippet to share? Submit it to our monthly tip contest and you could win a prize.

Dig Deeper on LotusScript

Start the conversation

Send me notifications when other members comment.

Please create a username to comment.

-ADS BY GOOGLE

SearchWindowsServer

Search400

  • iSeries tutorials

    Search400.com's tutorials provide in-depth information on the iSeries. Our iSeries tutorials address areas you need to know about...

  • V6R1 upgrade planning checklist

    When upgrading to V6R1, make sure your software will be supported, your programs will function and the correct PTFs have been ...

  • Connecting multiple iSeries systems through DDM

    Working with databases over multiple iSeries systems can be simple when remotely connecting logical partitions with distributed ...

SearchDataCenter

SearchContentManagement

Close