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
| Parameter | Type | Description |
|---|---|---|
dimension | string | The dimension's name or id. |
member | string | The element's name. |
Returns
booleantrue 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
}