# Session Variables

Session Variables are key/value pairs defined at the subsidiary level that are available throughout the workflows and pages built for that subsidiary. They let you pass consistent values (like a default currency, stock location, or location ID) into the portal without hardcoding them into each individual workflow module.

## Accessing Session Variables

{% stepper %}
{% step %}

### Open the NetSuite Admin view

Switch to **NetSuite Admin** in <code class="expression">space.vars.productName</code>.
{% endstep %}

{% step %}

### Select the subsidiary

Use the subsidiary switcher at the top right.
{% endstep %}

{% step %}

### Open Configurations

Click **Configurations** in the left sidebar, then scroll to the **Session Variables** section.
{% endstep %}
{% endstepper %}

## Fields

| Field                       | Description                                                                                                                                                               |
| --------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| **Show Debug Data**         | When enabled, a debug panel appears at the bottom of the portal showing the current session variable values. Useful during setup and testing; turn off before going live. |
| **Session Variables table** | The list of all defined variables for this subsidiary. Each row has a Type, Key, and Value.                                                                               |

## Variable columns

| Column    | Description                                                            |
| --------- | ---------------------------------------------------------------------- |
| **Type**  | The category of the variable (e.g. Currency, Stock Location, Location) |
| **Key**   | The variable name used to reference it in workflows and page blocks    |
| **Value** | The value assigned to this variable for this subsidiary                |

## Adding a session variable

{% stepper %}
{% step %}

### Click + Add Variable

A new empty row appears in the table.
{% endstep %}

{% step %}

### Pick a Type

Select or unselect the **Type** as appropriate.
{% endstep %}

{% step %}

### Set the Key

Pick a **Key** from the dropdown or enter a custom key: this is the name you'll reference in workflows.
{% endstep %}

{% step %}

### Set the Value

Enter the **Value** for this subsidiary.
{% endstep %}

{% step %}

### Save

Click **Save Changes** on the Configurations page.
{% endstep %}
{% endstepper %}

## Removing a session variable

Click the **×** icon on the right side of the variable row, then save.

## Common use cases

| Variable key    | Example value | Purpose                                                   |
| --------------- | ------------- | --------------------------------------------------------- |
| `currency`      | `USD`         | Ensures all transactions in this subsidiary use USD       |
| `stockLocation` | `6`           | Sets the default stock location for inventory lookups     |
| `location`      | `6`           | Sets the default NetSuite location ID for this subsidiary |

## Tips

* Use **Show Debug Data** when testing new workflows to confirm variables are resolving as expected.
* Session variable keys are case-sensitive. Make sure the key in the variable matches exactly what's referenced in your workflow blocks.
* Changes to session variables take effect immediately after saving; no republish or user logout required.

{% hint style="warning" %}
Turn off **Show Debug Data** before going live. It exposes internal session state to end users.
{% endhint %}

## Related Pages

<table data-view="cards"><thead><tr><th></th><th></th><th data-hidden data-card-target data-type="content-ref"></th></tr></thead><tbody><tr><td><strong>Configurations Overview</strong></td><td>All sections on the Configurations page.</td><td><a href="/pages/gogCTxJRLdzy1P6i1xeB">/pages/gogCTxJRLdzy1P6i1xeB</a></td></tr><tr><td><strong>Default Workflows</strong></td><td>Where session variables are used in workflow modules.</td><td><a href="/pages/NuNR9Ssy8uVrqIkLMt3v">/pages/NuNR9Ssy8uVrqIkLMt3v</a></td></tr><tr><td><strong>Module Variables (Client Admin)</strong></td><td>How Client Admins read and set session variables in their workflows.</td><td><a href="/pages/S9QlmvCWJ8AOsDrFpQtz">/pages/S9QlmvCWJ8AOsDrFpQtz</a></td></tr></tbody></table>


---

# 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.in8sync.com/netsuite-admin-guide/overview-1/session-variables.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.
