# How to access account constants inside code blocks

## What is the Problem? <a href="#howtoaccessaccountconstantsinsidecodeblocks-whatistheproblem" id="howtoaccessaccountconstantsinsidecodeblocks-whatistheproblem"></a>

The problem we are addressing is the need to access account variables within a code block. This can be challenging when trying to retrieve specific information related to the account.

## What is the Solution? <a href="#howtoaccessaccountconstantsinsidecodeblocks-whatisthesolution" id="howtoaccessaccountconstantsinsidecodeblocks-whatisthesolution"></a>

To access account constants within a code block, follow these steps:

1. **Utilize the Window Object**: To access account variables, make use of the `window` object in JavaScript.
2. **Use the Appropriate Path**: Once you have the `window` object, navigate through the following path: `window.jentis.config.jtm.accountconstants['Tealium_Data_Enrichment-tealium_account']`. Within the brackets, you can access any account constant you are using. You can find all of them by calling `window.jentis.config.jtm.accountconstants` from the console:

   <figure><img src="https://docs.jentis.com/__attachments/789545239/image-20230726-102715.png?inst-v=51858fdf-3184-45e9-9143-a0a09c4239be" alt=""><figcaption></figcaption></figure>
3. **Retrieve the Desired Information**: By following the given path, you will be able to retrieve the required account constants for further use within the code block.

## Summary <a href="#howtoaccessaccountconstantsinsidecodeblocks-summary" id="howtoaccessaccountconstantsinsidecodeblocks-summary"></a>

In summary, accessing account variables within code blocks can be achieved using the `window` object and the appropriate path to the desired account constants. By implementing this best practice, you can seamlessly retrieve and utilize the necessary information related to the account.

If you have any additional questions or need further assistance, please feel free to reach out to our customer support team. We are always here to help!


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.jentis.com/best-practices/how-to-access-account-constants-inside-code-blocks.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
