Skip to content

element.exists ​

Checks whether an element exists in a dimension.

It finds leaf and consolidated elements in any hierarchy, as well as orphans (elements that aren't in any hierarchy). The match isn't case-sensitive. It's the same check as dimension.hasMember. To check a single hierarchy instead, use hierarchy.hasMember.

js
element.exists(dimension, name)

Parameters ​

ParameterTypeDescription
dimensionstringThe dimension's name or id.
namestringThe element's name.

Returns ​

boolean

true when the element exists, otherwise false, including when the dimension can't be found.

Examples ​

js
if (element.exists("Account", "600010")) {
    // do something
}