Entry ColumnValues, multiple value fields

I have created an agent to print out all the values from all the Columns using an entry collection. The view is a categorized view with the first column being categorized from the Department field. For each entry my code goes like this:

OnError Resume Next

forall colval in entry.ColumnValues

print colval

End forall

Again, that first column value comes from a multi-value field, called Department, which in many cases has multiple values in it. For those entries with multiple values in it the print returns nothing for that column. I have, however, put together a check that actually implodes the column value to see if it then is a valid value, and that works. It returns something like this for those multi-value Department fields:

“Nursing Dept:Admin Dept:Emer Dept”

So when it’s printing out each entry the basic values look something like this:

Admin Dept

Nursing Dept:Admin Dept:Emer Dept

Beta Dept

Cappa Dept

Emer Dept

Nursing Dept:Admin Dept:Emer Dept

Emer Dept

Gopher Dept

Happy Dept

Igloo Dept

Nursing Dept

NursingDept:Admin Dept:Emer Dept

NursingDept

Zebra Dept

Each single entry displayed above would be the first column value from entries that have only one value in the Department field. For the single value Department entries everything is in alphabetical order, but the multi-value departments it just prints out the values as they appear in the multi-value Department fields.

So my question is, how does the view know what value is actually supposed to be used from the multi-value department field? And then, how am I supposed to know this? Is there some special way to know what value you are actually using in that categorized column?

My goal is to just return the value it’s supposed to be, not the entire string of values. Without imploding the columnValue it returns an error and is therefore left blank. I’m perplexed to know how the view knows what value is really supposed to be used when it’s printing out all the values.

Any thoughts? Thank you for reading.

Tim Williams

Subject: RE: Entry ColumnValues, multiple value fields

From the data available from the view entry, you probably won’t be able to tell. Clearly there’s some information there that LotusScript doesn’t expose. The only thing I can suggest offhand, if you’re iterating through the whole view, is to notice when you hit an entry with multiple values and store the noteID and occurrence count in a List variable (List As Integer, with the noteID used as the key value). That way, when you encounter the same document later, you’ll be able to tell how many times you’ve seen it before.

Or, of course, you can keep track of the value of the last single-valued field you encountered and scan thru the values looking for the “smallest” one that’s >= the last single-valued key. It’s a little more general but there are complications if you run into a lot of multivalue docs in a row.

Subject: Entry ColumnValues, multiple value fields

well looking at the way you’ve described it the line you are trying to display as multi value is in fact seen by notes as a single string value so you will have to do some work to separate the values. Try using the Split function to create an array then use your forall to loop through the array. Since you’re using a " : " as your delimeter you could do an IF statement to only split the values if the strin contains a colon.