PromptDesk Logo

PromptDesk OS

Prompt Variables

Prompt Variables

You can add prompt variables by using the {{variable}} Handlebars.js syntax. The following examples will always be fully supported in the PromptDesk OS and SDKs.

Simple Variables

{{first_name}}

Object Variables

{{user.name}}

Array Variables

{{user.emails[0]}}

Nested Variables

{{user.address.city}}

Each Loop

{{#each user.emails}}
- {{this}}
{{/each}}

If Conditional

{{#if user.emails}}
  {{user.emails[0]}}
{{else}}
  No emails
{{/if}}

Editing Prompt Variables

Add a prompt example:

  1. Define a variable using the {{variable}} syntax
  2. Click the "Variable" name
  3. Provide a variable value
  4. Click "Okay"

Completion Prompt

Previous
Managing Prompts