> ## Documentation Index
> Fetch the complete documentation index at: https://docs.intelleap.app/llms.txt
> Use this file to discover all available pages before exploring further.

# Variables and Scenarios

Variables and Scenarios define the data used throughout a prompt.

All variables are created and managed from the left sidebar of the Editor and are shared across all prompt variants within the same prompt.

## Scenarios

Scenarios store different values for the same set of variables.

When switching between scenarios, the variable structure remains unchanged. Only the values assigned to those variables are updated.

This makes it possible to test the same prompt against multiple input configurations without recreating variables.

New scenarios can be created from the scenario selector located at the top of the sidebar.

Users without full access can create up to three scenarios per prompt.

## Variables

Variables define the data available to prompt variants.

To create a variable, click the add variable action in the sidebar and select a variable type.

Intelleap supports three variable types:

<CardGroup cols={3}>
  <Card title="String">
    Plain text values for user inputs, instructions, parameters, and test data.
  </Card>

  <Card title="Chat History">
    Conversation context made of messages with roles and content.
  </Card>

  <Card title="JSON">
    Structured objects, arrays, and nested data edited in the JSON editor.
  </Card>
</CardGroup>

Once created, variables become available across all variants within the current prompt.

Users without full access can create up to ten variables per prompt.

## String Variables

String variables store plain text values.

They are commonly used for:

* User inputs
* Instructions
* Parameters
* Test data

Values can be edited directly within the sidebar.

## Chat History Variables

Chat History variables represent a sequence of messages.

Each message consists of:

* A role
* Content

Supported roles include:

* User
* Assistant
* System

Each message can contain one of the following content types:

* Text
* Image
* Document

Chat History variables are useful for simulating multi-turn conversations and passing conversation history to a model.

## JSON Variables

JSON variables store structured data using the built-in JSON editor.

The editor supports:

* Objects
* Arrays
* Nested structures
* Basic validation

Two editing modes are available:

* View
* Edit

View mode displays the JSON structure without allowing modifications.

Edit mode allows direct editing of the JSON content.

If the JSON structure contains errors, the editor highlights invalid fields and displays validation feedback.

## Drag-and-Drop

Intelleap supports drag-and-drop interactions in multiple areas of the Editor.

<CardGroup cols={3}>
  <Card title="Variables">
    Reorder variables within the sidebar without changing their values or behavior.
  </Card>

  <Card title="Chat History Messages">
    Reorder messages inside a Chat History variable without recreating them.
  </Card>

  <Card title="Context Blocks">
    Rearrange Context Before and Context After blocks inside a prompt variant.
  </Card>
</CardGroup>

<Note>
  The main prompt body remains fixed and cannot be reordered.
</Note>
