Skip to content

dimension.hasMember ​

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 element.exists. To check a single hierarchy instead, use hierarchy.hasMember.

js
dimension.hasMember(dimension, member)

Parameters ​

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

Returns ​

boolean

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

Examples ​

js
if (dimension.hasMember("Product", "Product A")) {
    // do something
}