getItemValueString (NotesXspDocument - JavaScript)

Gets the value of an item as a string.

Syntax

getItemValueString(name:string) : string
Parameter Description
name The name of the item.
Return value Description
string The item value.

Usage

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

If the item has multiple values, this method returns the first value.

If the item does not exist, this method returns an empty string.

If the item is a number or date, this method returns an empty string.

This method returns a rich text item rendered to plain text. Formatting and embedded objects are lost.

Examples

This data binding for a computed field returns the value of the Subject item in the document associated with the current XPage.
var s = document1.getItemValueString("Subject");
if(s == "") {
	return "Subject is empty or doesn't exist."
} else {
	return s;
}