# Button

You can use the button variable to trigger a set of actions such as setting the layout, ranking the data, or displaying data for a specific period.

### 1. Configuration <a href="#id-1.-configuration" id="id-1.-configuration"></a>

This section outlines configurations specific to button variables.

**1.1. Button icon:** Select an icon to display in the button.

<figure><img src="https://content.gitbook.com/content/sB9HAei8v4FfKkH9M4gw/blobs/eyR65dAREeCuZrXYVLEs/image.png" alt=""><figcaption><p>Button icon</p></figcaption></figure>

**1.2. Enable toggle scripts:** You can specify a set of actions to be applied when the button is enabled(Enabled Script) and another set of actions when the button is disabled(Disabled Script). The label on the button also changes based on the state of the button. The **Enabled Button Label,** **Disabled Button Label**, **Enabled Script**, and **Disabled Script** options will be available only when the **Enable toggle scripts** option is turned on.

<figure><img src="https://content.gitbook.com/content/sB9HAei8v4FfKkH9M4gw/blobs/LKYwGSMCvToD5Y8gT05G/image.png" alt=""><figcaption><p>Enable toggle scripts</p></figcaption></figure>

**1.3. Button label:** The text that is displayed on the button.

**1.4. Execute script:** You can use scripting functions to rank data, set conditional formatting, apply semantic formatting, handle nulls and zeroes, etc. [Learn more about scripting functions](https://docs.inforiver.com/premium-table/formula-syntax/scripting-functions).

<figure><img src="https://content.gitbook.com/content/sB9HAei8v4FfKkH9M4gw/blobs/T0Hl60KnOLL22R4XZplT/image.png" alt=""><figcaption><p>Button variables</p></figcaption></figure>

### 2. Examples <a href="#id-2.-examples" id="id-2.-examples"></a>

**2.1. Executing scripts**

**STEP 1:** Create a button variable with the configuration shown.

<figure><img src="https://2428652681-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FsB9HAei8v4FfKkH9M4gw%2Fuploads%2F4gVGm0WJkq3uFE91hnQ0%2Fimage.png?alt=media&#x26;token=cc37a59f-6af4-4178-8025-4c7ac56f1ef0" alt=""><figcaption><p>Create button</p></figcaption></figure>

**STEP 2:** Click the button from the variables side pane to execute the underlying scripts.

<figure><img src="https://2428652681-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FsB9HAei8v4FfKkH9M4gw%2Fuploads%2FOb6hh6RXN7nuW1i6AWRQ%2FUntitled%20Project.gif?alt=media&#x26;token=5b2896eb-514c-4268-b9f0-3ef20bbadd4c" alt=""><figcaption><p>Using button variables</p></figcaption></figure>
