Lotus Software logo
IBM Lotus Domino Designer 8.5
  Versions 8.5 and 8.5.1






GetItemValue method

Given the name of an item, returns the value of that item in a document.

Defined in

NotesDocument

Syntax

valueArray = notesDocument.GetItemValue( itemName$ )

Parameters

itemName$

String. The name of an item.

Return value

value

The value or values contained in the specified name. The data type of the value depends on the data type of the item.

Notes item type
Value return type

Rich text

Array of strings. The text in the item, rendered into plain text

Text or text list (includes Names, Authors, and Readers item types)

Array of strings

Number or number list

Array of doubles

Date-time or range of date-time values

Array of variants of type Date

When GetItemValue returns an array, each element in the array corresponds to a value in the item. If the item contains a single value, the array has just one element.

Usage

If multiple items have the same name, this method returns the value of the first item.

For text, number, and time-date items, GetItemValue always returns an array, even when there is only a single value in the item. If you know the item contains only a single value, access the first element in the array, which is at index 0. If you know the item contains multiple values, but you don't know how many, iterate over the array elements using the Forall statement.

To get a date-time value as an array of NotesDateTime and NotesDateRange objects, see GetItemValueDateTimeArray.

"Extended class" syntax

You can also access the contents of an item directly, without using GetItemValue. The following two statements are equivalent:

t = lastDoc.GetItemValue( "Topic" )

t = lastDoc.Topic

This syntax lets you access and modify items the same way you access and modify other NotesDocument properties. The return value is the same, that is, an array of values for text, number, or time-date items, and a string for rich text items.

You can set the value of an item with this syntax, too:

mailMemo.Subject = "Update on stock options"

Call mailMemo.Save( False, True )

While this syntax may be adequate for one-time scripts, you should prefer GetItemValue because:

For more information about setting an item value with this syntax, see the AppendItemValue and ReplaceItemValue methods.

Language cross-reference

getItemValue method in Java Document class

@Count function in formula language

@GetDocField function in formula language

@GetField function in formula language

@GetProfileField function in formula language

See examples

Examples: GetItemValue method
Related topics
Getting an item and its values in LotusScript classes
Getting text renditions of rich text items in LotusScript classes




Library | Support | Terms of use |

Last updated: Monday, October 5, 2009