Difference between revisions of "NXSL:GetCustomAttribute"

From NetXMS Wiki
Jump to navigation Jump to search
Line 1: Line 1:
__NOTOC__
__NOTOC__
Get value of node's custom attribute. Function returns requested attribute's value on success or NULL if given attribute does not exist.
Get value of node's custom attribute.


== Syntax ==
== Syntax ==
Line 15: Line 15:
== Return Value ==
== Return Value ==


String value of custom attribute or '''NULL''' if attribute is missing.
String value of requested custom attribute or '''NULL''' if attribute is missing.


== Notes ==
== Notes ==

Revision as of 11:34, 22 October 2014

Get value of node's custom attribute.

Syntax

GetCustomAttribute(node, attributeName)

Parameters

node Node object, you can use predefined variable $node to refer to current node. You can also use null as node if trusted nodes check is disabled (see Security Issues for more information).
attributeName Custom attribute name.

Return Value

String value of requested custom attribute or NULL if attribute is missing.

Notes

If attribute name conforms to NXSL identifier naming conventions, it can be accessed directly as node object attribute. For example “GetCustomAttribute($node, "my_attribute")” can be changed to “$node->my_attribute”

Examples

GetCustomAttribute($node, "my_attribute")	-> "my value"
GetCustomAttribute($node, "bad_attribute_name")	-> NULL