OpenDialog Docs
opendialog.aiStart BuildingTalk to an expert
  • GETTING STARTED
    • Introduction
    • Getting ready
    • Billing and plans
    • Quick Start AI Agents
      • Quick Start AI Agent
      • The "Start from Scratch" AI Agent
        • Chat Management Conversation
        • Welcome Conversation
        • Topic Conversation
        • Global No Match Conversation
        • Supporting LLM Actions
        • Semantic Classifier: Query Classifier
      • A Process Handling AI Agent
  • STEP BY STEP GUIDES
    • AI Agent Creation Overview
    • Add a new topic of discussion
    • Use knowledge sources via RAG
    • Adding a structured conversation
    • Add a 3rd party integration
    • Test and tweak your AI Agent
    • Publish your AI Agent
  • CORE CONCEPTS
    • OpenDialog Approach
      • Designing Conversational AI Agents
    • OpenDialog Platform
      • Scenarios
        • Conversations
        • Scenes
        • Turns and intents
      • Language Services
      • OpenDialog Account Management
        • Creating and managing users
        • Deleting OpenDialog account
        • Account Security
    • OpenDialog Conversation Engine
    • Contexts and attributes
      • Contexts
      • Attributes
      • Attribute Management
      • Conditions and operators
      • Composite Attributes
  • CREATE AI APPLICATIONS
    • Designing your application
      • Conversation Design
        • Conversational Patterns
          • Introduction to conversational patterns
          • Building robust assistants
            • Contextual help
            • Restart
            • End chat
            • Contextual and Global No Match
            • Contextual FAQ
          • Openings
            • Anatomy of an opening
            • Transactional openings
            • Additional information
          • Authentication
            • Components
            • Example dialog
            • Using in OpenDialog
          • Information collection
            • Components
            • Example dialog
            • Using in OpenDialog
            • Additional information
          • Recommendations
            • Components
            • Example dialog
            • Additional information
          • Extended telling
            • Components
            • Example dialog
            • Additional information
          • Repair
            • Types of repair
            • User request not understood
            • Example dialog
            • Additional information
          • Transfer
            • Components
            • Example dialog
            • Additional information
          • Closing
            • Components
            • Example dialog
            • Using in OpenDialog
            • Additional information
        • Best practices
          • Use Case
          • Subject Matter Expertise
          • Business Goals
          • User needs
            • Primary research
            • Secondary research
            • Outcome: user profile
          • Assistant personality
          • Sample dialogs
          • Conversation structure
          • API Integration Capabilities
          • NLU modeling
          • Testing strategy
          • The team
            • What does a conversation designer do
          • Select resources
      • Message Design
        • Message editor
        • Constructing Messages
        • Message Conditions
        • Messages best practices
        • Subsequent Messages - Virtual Intents
        • Using Attributes in Messages
        • Using Markdown in messages
        • Message Types
          • Text Message
          • Image Message
          • Button Message
          • Date Picker Message
          • Audio Message
          • Form Message
          • Full Page Message
          • Conversation Handover message
          • Autocomplete Message
          • Address Autocomplete Message
          • List Message
          • Rich Message
          • Location Message
          • E-Sign Message
          • File Upload Message
          • Meta Messages
            • Progress Bar Message
          • Attribute Message
      • Webchat Interface design
        • Webchat Interface Settings
        • Webchat Controls
      • Accessibility
      • Inclusive design
    • Leveraging Generative AI
      • Language Services
        • Semantic Intent Classifier
          • OpenAI
          • Azure
          • Google Gemini
          • Output attributes
        • Retrieval Augmented Generation
        • Example-based intent classification [Deprecated]
      • Interpreters
        • Available interpreters
          • OpenDialog interpreter
          • Amazon Lex interpreter
          • Google Dialogflow
            • Google Dialogflow interpreter
            • Google Dialogflow Knowledge Base
          • OpenAI interpreter
        • Using a language service interpreter
        • Interpreter Orchestration
        • Troubleshooting interpreters
      • LLM Actions
        • OpenAI
        • Azure OpenAI
        • Output attributes
        • Using conversation history (memory) in LLM actions
        • LLM Action Analytics
    • 3rd party Integrations in your application
      • Webhook actions
      • Actions from library
        • Freshdesk Action
        • Send to Email Action
        • Set Attributes Action
      • Conversation Hand-off
        • Chatwoot
    • Previewing your application
    • Launching your application
    • Monitoring your application
    • Debugging your application
    • Translating your application
    • FAQ
    • Troubleshooting and Common Problems
  • Developing With OpenDialog
    • Integrating with OpenDialog
    • Actions
      • Webhook actions
      • LLM actions
    • WebChat
      • Chat API
      • WebChat authentication
      • User Tracking
      • Load Webchat within page Element
      • How to enable JavaScript in your browser
      • SDK
        • Methods
        • Events
        • Custom Components
    • External APIs
  • Release Notes
    • Version 3 Upgrade Guide
    • Release Notes
Powered by GitBook
On this page
  • Notation
  • Message editor
  • Attribute Filters
  1. CREATE AI APPLICATIONS
  2. Designing your application
  3. Message Design

Using Attributes in Messages

PreviousSubsequent Messages - Virtual IntentsNextUsing Markdown in messages

Last updated 2 months ago

Attributes can be used in any message to customize the content. For example, the user's name can be added in the welcome message to personalize the experience.

Notation

Attributes are added to messages using curly braces {} and inside the curly braces we first add the context name (very often and by default the context is "user"), next we add a period (.) and then the attribute name. For example, the attribute first_name stored in the user context looks like this:

{user.first_name}

If the value of first_name is John, the message will display as "Hello John and welcome back to Prime Brands."

Note - If the attribute has no value or does not exist in the context given, the attribute reference is removed from the final message.

Message editor

To access the Attribute Management feature within the message editor for a given scenario:

  • Go to your workspace overview (Scenarios)

  • Select the scenario you would like to update

  • Select the message section under 'Design' in the left-hand menu

  • Select the message you would like to edit

  • Click within the 'Text' block for your chosen message

  • Activate Attribute Management by inputting an opening curly brace {

Attribute Filters

It may be necessary to filter or modify the value of an attribute before it is used in a message. To help with this, OpenDialog provides a number of built-in filters to use when referencing attributes in the message editor.

Filters are applied to attributes using a pipe (|) and they can be chained together with the result of a filter being passed through into the next filter. For instance:

{ user.age | number_to_words | uppercase_first }

The above takes the value of the age attribute in the user context, converts the number to words and adds an uppercase the first letter. If age was 30, the value placed in the message would be 'Thirty'.

Available Filters

String filters

  • uppercase - uppercases all letters in the string

  • uppercase_words - uppercases the first letter of each word in the string

  • uppercase_first - uppercases only the first letter in the string

  • lowercase - lowercases the entire string

Number Filters

  • speltnumber_to_words - turns a number into its word. eg 1 => 'one'

  • ordinal - returns the ordinal of the number. eg 1 => 1st

  • ordinal_words - returns the ordinal spelt out. eg 1 => 'first'

Collection Filters

  • count - returns the number of items in a collection type attribute

  • where [field] [value] [operation?] - filters out elements based on a field and a value, such as { history.utterances | where participant user } to get all of the user utterances in the conversation history

  • range [start] [number] - returns a subset of the collection, such as {history.intents | range -3 2 }conv to get the second and third from last intent names in the conversation history.

  • last - returns the last element of the collection.

Conversation Object Filters

For video lessons and hands-on practice with these concepts, consider signing up for the OpenDialog Academy lessons by emailing academy@opendialog.ai.

For more information around using, creating and finding attributes within the message editor, follow this link to the documentation

select [field] - selects a name or description from a conversation object, such as { conversation.current_conversation | select name }. These attributes can be found within the .

Conversation context
Attribute Management
Edit Message screen
The attribute input field can be accessed within the message editor section of the conversation designer