OpenWGA 7.2 - TMLScript reference

TMLContext "this"
Method :

item(itemname)

On object TMLContext "this"
Usage Returns the value of an item or a WebTML variable
Description This is them TMLScript pendant of the WebTML tag <tml:item type="content">. It returns the values of items from the current context content document or of a WebTML variable of any type.

Items of this type can also be retrieved via a shortcut syntax, described on the documentation of the object.

This method only returns single values of items and WebTML variables that have been set via WebTML. If it is used to retrieve list items or variables of these types it will only return the first element of the list. To retrieve the whole list use method this.itemList() instead.

This is different when a list item or variable was set via TMLScript. On that occasion the method will also return the complete list to guarantee straightforward behaviour.
Parameters itemname (String):
Name of the item/variable to retrieve
Return value Value of the item or WebTML variable. Returns null if no field of that name exists.
Allowed in script types
  • WebTML pages and normal WebTML actions
  • Master actions
  • TMLScript tasks in jobs
  • Content type events
Examples

Returns a simple content document item or a WebTML variable (if that is defined):

this.item("myFlightInformation")

The same in shortcut syntaxes, first omitting the optional "this" then using the property  shortcut:

item("myFlightInformation")

myFlightInformation