---
source: https://qlik.dev/extend/build-extension/consuming-data/
last_updated: 2025-07-08T16:09:30Z
---

# Consume data

## Access layout

You can access the *layout* of the Generic Object through a set of predefined hooks.

### useLayout

`useLayout` returns the evaluated layout of the Generic Object's properties:

```js
import { useLayout } from "@nebula.js/stardust";

export default function () {
  return {
    qae: {
      properties: {
        qHyperCubeDef: {},
        simpleMath: {
          qValueExpression: {
            qExpr: "1+1",
          },
        },
      },
    },
    component() {
      const layout = useLayout();
      console.log(layout); // { qHyperCube: {/* HyperCube Layout */}, simpleMath: 2 }
    },
  };
}
```

You should `useEffect` when observing changes on the `layout`:

```js
const layout = useLayout();

useEffect(() => {
  // do some heavy update
}, [layout]);
```

### useAppLayout

`useAppLayout` returns the
[NxAppLayout](https://qlik.dev/apis/json-rpc/qix/schemas#%23%2Fdefinitions%2Fschemas%2Fentries%2FNxAppLayout) you are
currently connected to:

```js
import { useAppLayout } from "@nebula.js/stardust";

export default function () {
  return {
    component() {
      const appLayout = useAppLayout();
      console.log(appLayout); // { qTitle: 'App title', qLocaleInfo: {/* */ } }
    },
  };
}
```

The most common use case for the app layout is to access `qLocaleInfo` which
contains locale details selected by the app owner and should be used to format
numbers.

## Models

In addition to the layouts of the app and generic object, you have full access
to the APIs generated by `enigma.js`. These APIs are generated from a JSON-RPC
schema and unlocks the full power of Qlik's Associate Engine.

### useModel

`useModel` returns the generated API of the [Generic Object](https://qlik.dev/apis/json-rpc/qix/schemas/#nxapplayout):

```js
import { useModel } from "@nebula.js/stardust";

export default function () {
  return {
    component() {
      const model = useModel();
      model.getInfo().then((info) => {
        console.log(info);
      });
    },
  };
}
```

Common operations in this API is to:

- make selections with `beginSelections`, `selectHyperCubeValues` and `endSelections`
- get more data with `getHyperCubeData`

### useApp

`useApp` returns the generated API of the [Doc](https://qlik.dev/apis/json-rpc/qix/doc#%23%2Fentries%2FDoc):

```js
import { useApp } from "@nebula.js/stardust";

export default function () {
  return {
    component() {
      const app = useApp();
      app.clearAll();
    },
  };
}
```

Common operations in this API is to:

- modify the selection stack with `clearAll`, `back`, `forward`
- create and apply bookmarks with `createBookmark` and `applyBookmark`

### useGlobal

`useGlobal` returns the generated API of the [Global](https://qlik.dev/apis/json-rpc/qix/global#%23%2Fentries%2FGlobal):

```js
import { useGlobal } from "@nebula.js/stardust";

export default function () {
  return {
    component() {
      const g = useGlobal();
      g.engineVersion().then((v) => {
        console.log(v);
      });
    },
  };
}
```

Common operations in this API is to:

- get a list of apps with `getDocList`
