---
url: /excel-addin/childgetfirst.md
description: >-
  ChildGetFirst is run during the initial pass, and can be used when another
  MODLR function relies on a child element that needs to be retrieved first.
---

# ChildGetFirst

ChildGetFirst is run during the initial pass, and can be used when another MODLR function relies on a child element that needs to be retrieved first. Other than being run during the initial pass, ChildGetFirst is functionally identical to [ChildGet](/excel-addin/childget), in the same way that [CubeGetFirst](/excel-addin/cubegetfirst) relates to [CubeGet](/excel-addin/cubeget).

Retrieves the child element of a provided parent element in the provided dimension and hierarchy at the given index. Indexing is zero based.

See [FAQ](/excel-addin/faq#function-execution-ordering) for more details about function runtime ordering.

```js
ChildGetFirst(applicationName, dimension, hierarchy, elementName, index)
```

#### Parameters

* `applicationName` - The name of the application to work in.
* `dimension` - The dimension in which to find the element.
* `hierarchy` - The hierarchy in which to find the element.
* `elementName` - The identifier of the element for which we will return a child element.
* `index` - The index of the child element to be returned. (zero based)

#### Example

```js
ChildGetFirst("Sales Training Application", "Product", "Default", "All Products", 0)
```

This returns the first child of "All Products" in the "Default" hierarchy of the "Product" dimension, for example "Coolers Complete".

## Calculation order

If a CubeGet uses the result of a ChildGetFirst as one of its elements, and the input the ChildGetFirst depends on changes, the CubeGet shows `*RECALC` until the next refresh. Refresh again to resolve it.
