> For the complete documentation index, see [llms.txt](https://docs.inforiver.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.inforiver.com/display-settings/on-load-scripting.md).

# On-load scripting

Inforiver’s on-load scripting feature enables you to list a set of actions to be performed on loading the visual. You can display messages, set the layout, hide columns, or apply filters as the visual is loaded. The scripts will be executed when you open the report, switch to the tab containing the visual, or refresh the visual. &#x20;

Inforiver offers an array of built-in functions that you can use to set up scripts effortlessly. [Learn more about scripting functions.](/formula-syntax/scripting-functions.md)

<figure><img src="/files/Of2NGiO40UjKWvw6uaay" alt=""><figcaption><p>On load scripts</p></figcaption></figure>

Notice how all the scripts have been executed when the visual is loaded.

{% hint style="info" %}
To see the scripts in action, click the Run now button
{% endhint %}

<figure><img src="/files/P9XAEmMFCIRzQuY2PHg2" alt=""><figcaption><p>Executing on-load scripts</p></figcaption></figure>

Let's look at some applications of on-load scripts.

#### 1. Displaying messages

You can display custom text as a toast message notification. The supported types include alerts, information, warnings, and success messages among others. [Learn more about the DISPLAYTOAST function.](/formula-syntax/scripting-functions/displaytoast.md)

<div><figure><img src="/files/Fa38bRJrrRS0SjiD2woz" alt=""><figcaption><p>Alert message</p></figcaption></figure> <figure><img src="/files/UohVs3rgGqwq7imm3eZE" alt=""><figcaption><p>Info message</p></figcaption></figure> <figure><img src="/files/4IN2zOg8y50U7R9MvJT1" alt=""><figcaption><p>Warning message</p></figcaption></figure></div>

#### 2. Setting the layout

You can set a particular theme or expand hierarchical data to a specific level. [Learn more about the LAYOUT function](/formula-syntax/scripting-functions/layout.md).

<div><figure><img src="/files/klzUlm0LXlfLVlcyIYBr" alt=""><figcaption><p>Setting the theme and layout</p></figcaption></figure> <figure><img src="/files/V9J5kTgvX1XvGRxGOXEk" alt=""><figcaption><p>Navigating to a particular hierarchy level</p></figcaption></figure></div>

#### 3. Filtering periodic data

You can filter the data to show only a specific time period, for instance, the last 4 months or the last 2 years. [Learn more about filtering time series data](/formula-syntax/scripting-functions/showbetweenperiod.md).

<figure><img src="/files/vROp2TjBQFyOQr5TlBQj" alt=""><figcaption><p>Displaying next 4 months when current month is May</p></figcaption></figure>


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## 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, and the optional `goal` query parameter:

```
GET https://docs.inforiver.com/display-settings/on-load-scripting.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
