# Template variables reference

Template variables allow you to customize automation messages with dynamic data from recordings and captures. This guide provides a complete reference of all available variables, organized by category with usage examples.

***

### Overview

Template variables are placeholders you insert into message templates that get replaced with actual data when automations execute. They use double-brace syntax:

```
{{variable.name}}
```

All variables are optional. If data doesn't exist for a recording, the variable will appear empty but won't cause errors.

***

### Recording Variables

Variables that pull data directly from the recording or capture that triggered the automation.

#### Basic Recording Information

| Variable                       | Description                   | Example                                   | Always Available |
| ------------------------------ | ----------------------------- | ----------------------------------------- | ---------------- |
| `{{recording.title}}`          | Recording title               | "Checkout page crash"                     | Yes              |
| `{{recording.description}}`    | Recording description         | "Getting error when..."                   | No               |
| `{{recording.url}}`            | Direct link to view recording | "<https://app.screendesk.io/r/abc123>..." | Yes              |
| `{{recording.duration}}`       | Length in seconds             | "45"                                      | Yes              |
| `{{recording.created_at}}`     | Submission timestamp          | "Feb 6, 2026 at 2:30 PM"                  | Yes              |
| `{{recording.created_at_iso}}` | ISO 8601 timestamp            | "2026-02-06T14:30:00Z"                    | Yes              |

#### Customer Information

| Variable                       | Description                        | Example               | Always Available |
| ------------------------------ | ---------------------------------- | --------------------- | ---------------- |
| `{{recording.customer_email}}` | Email of person who submitted      | "<user@customer.com>" | No               |
| `{{recording.customer_name}}`  | Name of person who submitted       | "John Smith"          | No               |
| `{{recording.customer_id}}`    | External customer ID               | "cust\_12345"         | No               |
| `{{recording.account_name}}`   | Name of customer's account/company | "Acme Corp"           | No               |

#### Technical Details

| Variable                        | Description              | Example                      | Always Available |
| ------------------------------- | ------------------------ | ---------------------------- | ---------------- |
| `{{recording.browser}}`         | Browser name and version | "Chrome 121.0.6167"          | No               |
| `{{recording.browser_name}}`    | Browser name only        | "Chrome"                     | No               |
| `{{recording.browser_version}}` | Browser version only     | "121.0.6167"                 | No               |
| `{{recording.os}}`              | Operating system         | "macOS 14.3"                 | No               |
| `{{recording.os_name}}`         | OS name only             | "macOS"                      | No               |
| `{{recording.os_version}}`      | OS version only          | "14.3"                       | No               |
| `{{recording.resolution}}`      | Screen resolution        | "2560x1440"                  | No               |
| `{{recording.screen_size}}`     | Device screen size       | "1920x1080"                  | No               |
| `{{recording.viewport}}`        | Viewport dimensions      | "1440x900"                   | No               |
| `{{recording.platform}}`        | Device platform          | "desktop" or "mobile"        | No               |
| `{{recording.device_type}}`     | Device type              | "MacBook Pro" or "iPhone 14" | No               |

#### Geographic Information

| Variable                     | Description      | Example                | Always Available |
| ---------------------------- | ---------------- | ---------------------- | ---------------- |
| `{{recording.country}}`      | Country name     | "United States"        | No               |
| `{{recording.country_code}}` | ISO country code | "US"                   | No               |
| `{{recording.city}}`         | City location    | "San Francisco"        | No               |
| `{{recording.region}}`       | Region/state     | "California"           | No               |
| `{{recording.ip_address}}`   | IP address       | "203.0.113.42"         | No               |
| `{{recording.timezone}}`     | Timezone         | "America/Los\_Angeles" | No               |
| `{{recording.locale}}`       | Browser locale   | "en-US"                | No               |

#### Network Information

| Variable                     | Description               | Example           | Always Available |
| ---------------------------- | ------------------------- | ----------------- | ---------------- |
| `{{recording.network_type}}` | Network type              | "4g" or "wifi"    | No               |
| `{{recording.isp}}`          | Internet service provider | "Comcast"         | No               |
| `{{recording.downlink}}`     | Network speed (Mbps)      | "25"              | No               |
| `{{recording.is_vpn}}`       | VPN detection             | "true" or "false" | No               |

#### Content Analysis

| Variable                       | Description                           | Example                         | Always Available |
| ------------------------------ | ------------------------------------- | ------------------------------- | ---------------- |
| `{{recording.summary}}`        | AI-generated summary                  | "User encountered..."           | No               |
| `{{recording.suggestion}}`     | AI suggestion/analysis                | "This appears to be..."         | No               |
| `{{recording.ai_sentiment}}`   | Sentiment analysis                    | "frustrated" or "neutral"       | No               |
| `{{recording.transcript}}`     | Full audio transcription              | "The user says: hello..."       | No               |
| `{{recording.console_errors}}` | JavaScript console errors (formatted) | "Uncaught TypeError: Cannot..." | No               |
| `{{recording.network_errors}}` | Failed HTTP requests (formatted)      | "POST /api/checkout 500..."     | No               |

#### Recording Metadata

| Variable                          | Description                 | Example                                   | Always Available |
| --------------------------------- | --------------------------- | ----------------------------------------- | ---------------- |
| `{{recording.session_id}}`        | Unique session identifier   | "sess\_abc123xyz"                         | Yes              |
| `{{recording.user_agent}}`        | Full user agent string      | "Mozilla/5.0 (Macintosh..."               | No               |
| `{{recording.source}}`            | How recording was submitted | "feedback\_widget" or "chrome\_extension" | No               |
| `{{recording.vendor}}`            | Recording source vendor     | "screendesk"                              | No               |
| `{{recording.impressions_count}}` | Number of times viewed      | "5"                                       | Yes              |
| `{{recording.views_count}}`       | Total view count            | "12"                                      | Yes              |

#### Engagement Metrics

| Variable                   | Description                   | Example           | Always Available |
| -------------------------- | ----------------------------- | ----------------- | ---------------- |
| `{{recording.first_view}}` | Is first view of recording    | "true" or "false" | Yes              |
| `{{recording.received}}`   | Has recording been viewed     | "true" or "false" | Yes              |
| `{{recording.sent}}`       | Recording sent to third party | "true" or "false" | Yes              |

***

### Folder Variables

Variables that reference the folder the automation is configured on.

| Variable                 | Description           | Example                                      | Always Available |
| ------------------------ | --------------------- | -------------------------------------------- | ---------------- |
| `{{folder.name}}`        | Folder name           | "Bug Reports"                                | Yes              |
| `{{folder.id}}`          | Folder ID             | "folder\_12345"                              | Yes              |
| `{{folder.description}}` | Folder description    | "All customer-reported bugs"                 | No               |
| `{{folder.url}}`         | Direct link to folder | "<https://app.screendesk.io/folders/abc123>" | Yes              |

***

### Account/Workspace Variables

Variables that reference the workspace where the automation runs.

| Variable            | Description             | Example                                 | Always Available |
| ------------------- | ----------------------- | --------------------------------------- | ---------------- |
| `{{account.name}}`  | Workspace name          | "Acme Corp Engineering"                 | Yes              |
| `{{account.id}}`    | Workspace ID            | "acc\_12345"                            | Yes              |
| `{{account.email}}` | Workspace email/domain  | "acme.com"                              | No               |
| `{{account.url}}`   | Workspace dashboard URL | "<https://app.screendesk.io/dashboard>" | Yes              |

***

### User Variables

Variables related to the user who submitted the recording (if available).

| Variable         | Description        | Example               | Always Available |
| ---------------- | ------------------ | --------------------- | ---------------- |
| `{{user.name}}`  | User full name     | "Alice Johnson"       | No               |
| `{{user.email}}` | User email address | "<alice@company.com>" | No               |
| `{{user.id}}`    | User ID            | "user\_12345"         | No               |

***

### System Variables

Variables that provide system-level information.

| Variable              | Description             | Example                  | Always Available |
| --------------------- | ----------------------- | ------------------------ | ---------------- |
| `{{timestamp}}`       | Current execution time  | "Feb 6, 2026 at 2:35 PM" | Yes              |
| `{{timestamp_iso}}`   | ISO 8601 execution time | "2026-02-06T14:35:00Z"   | Yes              |
| `{{automation.name}}` | Automation name         | "Email to Engineering"   | Yes              |
| `{{automation.id}}`   | Automation ID           | "auto\_12345"            | Yes              |

***

### Usage Examples

#### Email Subject Lines

```
# Simple notification
New recording: {{recording.title}}

# Include customer
Bug from {{recording.customer_email}}: {{recording.title}}

# Add urgency
🚨 CRITICAL: {{recording.title}} ({{recording.customer_name}})

# Include folder context
[{{folder.name}}] {{recording.title}} - {{recording.country}}

# Time-based
{{recording.created_at}} - {{recording.title}} from {{recording.customer_email}}
```

#### Slack Message Templates

```
# Simple format
New bug report: *{{recording.title}}* from {{recording.customer_email}}
Folder: {{folder.name}} | Duration: {{recording.duration}}s

# Rich format with emoji
🐛 *{{recording.title}}*
Reported by: {{recording.customer_email}}
Location: {{recording.city}}, {{recording.country}}
Browser: {{recording.browser}}
<{{recording.url}}|View Recording>

# With analysis
*{{recording.title}}*
Sentiment: {{recording.ai_sentiment}}
Summary: {{recording.summary}}
Duration: {{recording.duration}}s
```

#### Webhook Payloads

```json
{
  "event": "recording.created",
  "recording": {
    "title": "{{recording.title}}",
    "url": "{{recording.url}}",
    "duration": {{recording.duration}},
    "customer": {
      "email": "{{recording.customer_email}}",
      "name": "{{recording.customer_name}}"
    },
    "device": {
      "browser": "{{recording.browser}}",
      "os": "{{recording.os}}",
      "resolution": "{{recording.resolution}}"
    },
    "location": {
      "country": "{{recording.country}}",
      "city": "{{recording.city}}"
    }
  },
  "folder": {
    "name": "{{folder.name}}",
    "id": "{{folder.id}}"
  },
  "timestamp": "{{timestamp_iso}}"
}
```

#### Ticket Creation

```
Title: [{{folder.name}}] {{recording.title}}

Description:
Customer: {{recording.customer_email}}
Duration: {{recording.duration}} seconds
Browser: {{recording.browser}} on {{recording.os}}
Location: {{recording.city}}, {{recording.country}}

Summary:
{{recording.summary}}

Link: {{recording.url}}

---
Created automatically by Screendesk automation on {{timestamp}}
```

***

### Variable Placement

#### Valid Placement Locations

Template variables can be used in:

| Feature                   | Supported |
| ------------------------- | --------- |
| Email subject lines       | ✅ Yes     |
| Email body (HTML)         | ✅ Yes     |
| Slack message text        | ✅ Yes     |
| Slack message attachments | ✅ Yes     |
| Webhook JSON payload      | ✅ Yes     |
| Webhook URL path          | ✅ Yes     |
| Webhook headers           | ✅ Yes     |
| Ticket title              | ✅ Yes     |
| Ticket description        | ✅ Yes     |
| Ticket labels             | ✅ Yes     |
| Custom fields             | ✅ Yes     |

#### Invalid Placement

Variables are **not supported** in:

* Automation condition logic (if/when rules)
* Recipient email addresses
* Webhook URLs (base URL portion)
* Channel selection logic

***

### Best Practices

#### 1. Check Variable Availability

Some variables may not be available for all recordings. Use fallback text:

```
# Good - handles missing data
Browser: {{recording.browser}} (if empty, appears blank but doesn't error)

# Risky - assumes data exists
Must use {{recording.summary}} (fails if summary doesn't exist)
```

#### 2. Use Consistent Formatting

Keep template variable spacing consistent:

```
# Good - consistent spacing
{{recording.title}}
{{ recording.title }}

# Bad - inconsistent
{{recording.title }} or {{ recording.title}}
```

#### 3. Escape HTML in Contexts

When using variables in HTML email templates, consider escaping:

```html
<!-- Good - escaped -->
<p>Title: <strong>{{recording.title}}</strong></p>

<!-- Risky - unescaped in attribute -->
<a href="{{recording.url}}">Click here</a>
<!-- Works but URL could break with special characters -->
```

#### 4. Limit Template Nesting

Don't nest variables:

```
# ❌ Invalid - nesting not supported
{{recording.{{dynamic_field}}}}

# ✅ Valid - single variable
{{recording.title}}
```

#### 5. Keep Templates Readable

Format templates for clarity, especially in email bodies:

```html
<!-- Good - clear structure -->
<p><strong>Title:</strong> {{recording.title}}</p>
<p><strong>Customer:</strong> {{recording.customer_email}}</p>
<p><strong>Browser:</strong> {{recording.browser}}</p>

<!-- Less clear - harder to scan -->
{{recording.title}} - {{recording.customer_email}} - {{recording.browser}}
```

#### 6. Test with Sample Data

Always test templates before activating:

1. Send a test email/message
2. Verify all variables populated correctly
3. Check that no `{{}}` brackets appear in output
4. Confirm formatting looks good
5. Test links and buttons work

***

### Troubleshooting Variables

#### Variables Not Populating

**Symptom:** Template shows `{{variable.name}}` instead of actual value

**Solutions:**

1. Check spelling exactly - variables are case-sensitive: `{{recording.title}}` ✓ vs `{{Recording.Title}}` ✗
2. Ensure double braces: `{{ }}` not `{ }` or `[ ]`
3. Verify the data exists (not all recordings have summaries or errors)
4. Check variable is in supported placement location

#### Empty Variables

**Symptom:** Variable appears blank in output

**Possible Causes:**

* Recording doesn't have that data
* Data wasn't captured (e.g., no console errors if page didn't error)
* Field is optional and wasn't filled by customer

**Solution:** This is normal behavior. Use text around variables to add context:

```
# Instead of just: {{recording.summary}}

# Try:
Summary: {{recording.summary}} (or empty if no AI analysis)
```

#### Special Characters Breaking Template

**Symptom:** Email/message formatting breaks when variable contains special characters

**Solution:** If template data might contain quotes, HTML, or special chars:

```html
<!-- Escape in HTML context -->
<p>Title: <strong>{{recording.title | html_escape}}</strong></p>

<!-- Or simpler - use plain text view -->
Title: {{recording.title}}
```

#### URL Parameters with Variables

**Symptom:** URL parameter doesn't work with variable value

**Note:** Variables should not be placed in URL base paths. Always use:

```
# ✅ Correct - variable in query parameter
{{recording.url}}

# ❌ Wrong - would break the URL
/api/webhook?folder={{folder.id}}&recording={{recording.id}}
```

***

### Variable Limits and Constraints

| Aspect                          | Limit             | Notes                                     |
| ------------------------------- | ----------------- | ----------------------------------------- |
| Variables per template          | Unlimited         | Use as many as needed                     |
| Template size                   | 10,000 characters | Applies to full message/template          |
| Variable name length            | 100 characters    | Technical limit, actual vars much shorter |
| Variable replacement depth      | 1 level           | No nested variables                       |
| Special characters in variables | Supported         | Will be replaced with actual values       |


---

# 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.screendesk.io/organization-and-workflows/automations/template-variables-reference.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.
