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
| Parameter | Type | Description |
|---|---|---|
dimension | string | The dimension's name or id. |
name | string | The element's name. |
Returns
booleantrue when the element exists, otherwise false, including when the dimension can't be found.
Examples
js
if (element.exists("Account", "600010")) {
// do something
}