LogoLogo
Changelog
18.5
18.5
  • Welcome
    • Welcome to Airkit 👋
    • Quickstart
  • Concepts
    • Sessions
      • Linking to Sessions
    • Actors
      • Conversations with Actors
  • Tutorials
    • Building A Contact Form
      • Building the Web UI
      • Building the Database
      • Finalizing the App
      • Connecting Forms to Salesforce
    • Styles, Themes, and Templates
      • Changing the header
      • Changing the Theme
      • Using a custom font
      • Using Animations
    • Multi-Page Form
      • Creating the App Object in AirData
      • Building the Form’s UI
      • Creating the Data Flow to insert data
      • Connecting the Data Flow to the UI
      • Previewing and Publishing the app
    • Scheduling and Follow-Up App
      • Collecting Contact Information
      • Creating Appointment Times
      • Saving Appointment Information
      • Scheduling Appointment Reminder
      • Automating Proactive Follow-Up
      • Requesting Feedback
    • Custom Integrations (Petfinder App)
      • Querying the Petfinder API
      • Displaying Petfinder Data
  • Platform
    • Console
      • Apps
      • Activity
      • App Health
      • Datastores
      • Integrations
      • Conversations
      • Resources
      • API
      • Settings
    • Studio
      • Builder Bar
        • Triggers Builder
        • Web Flows Builder
        • Chat Bots Builder
        • Answer Flows Builder
        • Voice Bots Builder
        • Connections Builder
        • Notifications Builder
        • AirData Builder
        • Media Library
        • Theme Builder
        • Schedules Builder
        • Settings
      • App Preview
      • Data Flows
      • Variable Tree
      • Data Model Editor
      • Events
        • Session Started Events
        • Trigger Events
        • Control Events
        • Session Events
        • Activity Group Events
        • Action Chains
  • Data and Integrations
    • Working with Data
      • Variable Namespaces
      • Standard Session Data
      • AirData
        • AirData App Objects
        • Datastores
        • Identity Objects
        • Place Objects
        • Schedule Objects
      • Airscript Quickstart
        • Working with Dates and Times
        • Working with Missing Values
        • Working with URLs and Base64
      • Pull Values from Lists and Objects
        • Path Expressions
        • Query Expressions
      • Making Forms from Data Models
    • Integrations
      • First Party Integrations
        • Creating A Salesforce Lead
        • Creating a Zendesk Ticket
        • Creating SFTP Credentials
        • Swagger Schema Validation
        • First Party Integration Reference
          • Airtable Integration
          • Genesys Widget Integration
          • Google Integration
          • Guidewire Integration
          • Hubspot Integration
          • Kustomer Integration
          • MX Integration
          • Plaid Integration
          • Salesforce Integration
          • SendGrid Integration
          • SFTP Integration
          • Shopify Integration
          • Stripe Integration
          • Twilio Integration
          • Zendesk Integration
      • Custom Integrations
        • OAuth 2.0
        • API Token
        • HTTP Basic Auth
        • Custom Token
        • SFTP
        • Examples: Twitter and Giphy
      • App APIs
        • Building an App API
      • Subscriptions (Web Hooks)
  • Texts, Calls and Emails
    • SMS
      • SMS Notification Basics
      • Chat Bot Basics
      • Texting Journey Links
      • Data from Inbound Calls/SMS
      • Connecting Twilio Numbers
    • Emails
      • Email Notification Basics
      • Sending Emails by Data Operation
      • Connecting Email Addresses
    • Voice Bots
      • Voice Bot Basics
    • Conversation Chat Bots
      • Setting Up Answer Groups
      • Configuring Conversation Chat Bots
        • Salesforce Relays
        • Kustomer Relays
  • Web Apps
    • Forms
      • Displaying Controls Dynamically
      • Repeating Elements
      • Prefilling Forms
      • Validation of User Data
      • Capture Secure User Data
      • Progress Bars
      • Dropdown Menus
      • Electronic Signatures
    • Calendars
      • Customizing Schedule Availability
      • Using Availability Schedules
      • Rescheduling Deflected Calls
      • Integrating to External Calendars
    • Maps and Addresses
      • Maps
      • Addresses
      • User's Current Location
      • Address Search Map Binding
    • Payments
      • Creating a Stripe Integration
    • Timers and Reminders
      • Setting Timers
      • Setting up Periodic Tasks
    • PDFs
      • Creating a PDF
      • Working with Existing PDFs
      • Adding Assets to PDF
    • Assets and Media
      • Using the File Upload Web Control
      • Working with Files and Media
      • Assets and Data Operations
      • Sending Assets to Remote Servers
    • Styling Overview
      • Web Control Styling Properties
        • Animations
      • Themes and Control Variants
        • Importing and Exporting Themes
      • Working with Custom Assets
      • Page Layouts
        • Creating an App Header
    • Publishing
      • Publish and Manage Deployments
      • Configure Application Resources
      • Editing an Application
      • Importing/Exporting Apps
      • Tying Variables to Deployments
    • Advanced
      • Custom Controls
      • Creating Custom Functions
    • Accessibility
      • Accessibility in Airkit
      • Connecting Labels to Input Controls
  • Authentication
    • SAML Authentication
    • OAuth 2.0 - Google
    • OAuth 2.0 - Okta
    • OAuth 2.0 - Auth0
    • Azure AD B2C
    • Authentication Apps and Secure Apps
  • Embeds
    • SDK Overview
      • SDK Quickstart
      • SDK Authentication
      • Passing Data
      • Configuration
      • Configuration Examples
      • Airkit Lightning Component (Salesforce)
  • Analytics and Administration
    • Airkit Organizations
    • Adding Users to Airkit
    • User Roles
      • Working with Custom Roles
    • JIT Provisioning for an Organization
    • SAML SSO for an Organization
    • Managing the Application Lifecycle
    • Environments
      • Environmental Governance
    • Getting Application Metadata
    • Custom Domains
    • Analytics Overview
      • App Events to Splunk
      • App Events to AWS S3 Buckets
      • Audit Logs to AWS S3 Buckets
      • View Data in Activity Explorer
      • Snowflake Analytics Schema
      • Power BI
      • Heap and GTM Integrations
        • Setting up Analytics with GTM
        • Setting up Analytics with Heap
    • Error Management
      • Logging Errors
      • Setting up Email Notifiers
      • Integrating Error Notifiers to Slack
  • Security and Compliance
    • App Security FAQ
    • Data Masking and Auditing
    • IP Ranges
    • Encrypting Data
    • SSL Auth
    • TCPA
    • Cookie Policies
    • Supported Browsers
    • Realms
  • Reference Docs
    • Reference Documentation Overview
    • Airscript
      • Text Functions
        • CAPITALIZE
        • CONCAT
        • ISSTRING
        • LOWERCASE
        • PADSTRING
        • REPLACE
        • REPT
        • SPLIT
        • STRING_COMPARE
        • STRING_FIND
        • STRIP
        • SUBSTITUTE
        • SUBSTRING
        • TITLECASE
        • TRIM
        • UPPERCASE
      • DateTime Functions
        • ADD_TO_DATE
        • ADD_TO_DATETIME
        • DATE
        • DATETIME
        • DATETIME_DELTA
        • DATETIME_FROM_FORMAT
        • DATETIME_FROM_TIMESTAMP
        • DATE_DELTA
        • DATE_FROM_DATETIME
        • DATE_FROM_FORMAT
        • DAY
        • DAYS
        • FORMAT_DATE
        • FORMAT_DATETIME
        • FORMAT_TIME
        • HOUR
        • ISO_WEEK
        • MINUTE
        • MONTH
        • NOW
        • SECOND
        • SUBTRACT_FROM_DATE
        • SUBTRACT_FROM_DATETIME
        • TIME
        • TIMESTAMP_FROM_DATETIME
        • TIME_DELTA
        • TIME_FROM_DATETIME
        • TIME_FROM_FORMAT
        • TODAY
        • UPDATE_DATE
        • UPDATE_DATETIME
        • UPDATE_DAY
        • UPDATE_HOUR
        • UPDATE_MILLISECOND
        • UPDATE_MINUTE
        • UPDATE_MONTH
        • UPDATE_SECOND
        • UPDATE_TIME
        • UPDATE_TIMEZONE
        • UPDATE_YEAR
        • WEEK
        • WEEKDAY
        • YEAR
      • List Functions
        • CONTAINS
        • FIRST
        • FLAT
        • JOIN
        • LAST
        • LENGTH
        • REMOVE_EMPTY
        • REVERSE
        • SHUFFLE
      • Object Functions
        • KEYS
        • MERGE_OBJECTS
        • OBJECT_TO_SOAP
        • OBJECT_TO_XML
        • SOAP_TO_OBJECT
        • SOAP_HEADER_TO_OBJECT
        • VALUES
        • XML_TO_OBJECT
      • Math Functions
        • ABS
        • ACOS
        • ACOSH
        • ACOT
        • ACOTH
        • ASIN
        • ASINH
        • ATAN
        • ATAN2
        • ATANH
        • CEILING
        • COMBIN
        • COMBINA
        • COS
        • COSH
        • COT
        • COTH
        • CSC
        • CSCH
        • DEGREES
        • EVEN
        • EXP
        • FACT
        • FACTDOUBLE
        • FLOOR
        • GCD
        • ISEVEN
        • ISNUMBER
        • ISODD
        • LATLNGDISTANCE
        • LCM
        • LN
        • LOG
        • MAX
        • MIN
        • MROUND
        • MULTINOMIAL
        • ODD
        • PI
        • POWER
        • PRODUCT
        • RADIANS
        • RANDOM
        • RANGE
        • ROUND
        • ROUNDDOWN
        • ROUNDUP
        • SEC
        • SECH
        • SIGN
        • SIN
        • SINH
        • SQRT
        • SQRTPI
        • SUM
        • SUMSQ
        • TAN
        • TANH
        • TRUNC
      • Conditional Functions
        • EQUAL
        • IF
        • ISEMPTY
        • ISNOTEMPTY
        • NOT
      • Currency Functions
        • CURRENCY
        • FORMAT_CURRENCY
        • PARSE_CURRENCY
      • Phone Functions
        • FORMAT_PHONE
        • ISPHONE
        • PARSE_PHONE
      • Email Functions
        • ISEMAIL
      • Number Formatting Functions
        • ARABIC
        • FORMAT_NUMBER
        • PARSE_NUMBER
        • ROMAN
      • Data Type Functions
        • FROM_JSON
        • TO_JSON
        • TYPEOF
      • Asset Functions
        • ASSET_SIZE
        • ASSET_STATE
        • ASSET_THUMBNAIL_URL
        • ASSET_TO_URI
        • ASSET_TYPE
        • URI_TO_ASSET
      • Encoding Functions
        • BASE
        • BASE64_DECODE
        • BASE64_ENCODE
        • HMAC_MD5
        • HMAC_SHA1
        • HMAC_SHA256
        • MD5
        • SHA1
        • SHA256
        • URL_DECODE
        • URL_ENCODE
        • UUID
        • VALUE_OF
      • Error Handling Functions
        • THROW
        • TRY
      • Form and Validation Functions
        • FIRST_VALIDATION
        • RUN_VALIDATIONS
      • Arithmetic Operators
        • Addition (+)
        • Subtraction (-)
        • Multiplication (*)
        • Division (/)
        • Remainder (%)
      • Comparison Operators
        • Equality (=)
        • Inequality (<>, !=)
        • Ordering (<, <=, > , >=)
      • Logical Operators
        • AND
        • OR
        • XOR
        • Null Coalescing Operator (??)
      • Advanced Expressions
        • LET...IN
        • User Defined Functions
    • Web Controls
      • Button
      • Checkbox
      • Chat
      • Simple Checkbox List
      • Container
      • Container List
      • Credit Card
      • Currency Input
      • Date Input
      • Date Picker
      • Dropdown List
      • Email Input
      • Embedded External Content (iFrame)
      • Fieldset Container
      • File Upload
      • Form
      • Hyperlink
      • Image
      • Inline Container
      • Label
      • Map
      • Markdown
      • Number Input
      • Payment Request Button
      • Phone Input
      • Place Search Input
      • Progress Bar
      • QR Code
      • Radio Button
      • Simple Radio List
      • Scheduler
      • Secure String Input
      • Selectable Container
      • Signature Input
      • Text Area
      • Text Input
      • Time Input
      • Web Flow
      • Web Page
    • Voice and Chat Controls
      • Decision Menu
      • Forward Call
      • Secure Touchtone Capture
      • Text Response Capture
      • Touchtone Capture
    • Data Operations
      • AirData Request
        • DELETE
        • PUT
        • INSERT
        • PATCH
        • QUERY
        • DEPRECATED_QUERY
      • Calendar Search
      • Close Conversation
      • Conversation Transcript
      • Create File
      • Delete Assets
      • Download Encoded Asset
      • Early Return
      • Fetch Agent Information
      • Fetch Asset Details
      • Fetch Routing Flow Stats
      • Find Conversations by Customer Identifier
      • Fill PDF Form
      • Google
      • HTML to PDF
      • HTTP Request
        • Using an API With Paging
      • JWT Generation
      • Merge PDF
      • Move Conversation to Routing Flow
      • Opt Out Search
      • Opt Out List
      • Run Data Flow
      • Run Event in Journey
      • Salesforce
      • Secure Value Retrieval
      • Send Email
      • Send Message to Conversation
      • SFTP
      • Start Journey
      • Swagger Schema Validation
      • Transform
      • Update Customer Identifier
      • Wait
      • XML to JSON
      • Zendesk
      • ZIP File
    • Actions
      • Analytics Identify
      • Analytics Send Event
      • Close Modal
      • Condition
      • End Session
      • Extend Session Expiration Time
      • Initialize Actor
      • Log Custom Event
      • Metric: Count
      • Metric: Field
      • Metric: Start Timer
      • Metric: Statistic
      • Metric: Stop Timer
      • Navigate To Web Flow
      • Navigate to Web Page
      • Open Modal
      • Run Data Flow
      • Run Data Flow Repeatedly
      • Run Embedded Outgoing Event
      • Run Event
      • Send Email
      • Send SMS
      • Set Authentication
      • Set Identifier
      • Set Variable
      • Start Chat Bot
      • Start Voice Bot
      • Start Timer
      • Stop Timer
      • Throw
      • Trigger Form Validation
      • Try
    • Conversation Actions
      • Ask A Question
      • Capture User Response
      • Close Conversation
      • Move Customer to Resource
      • Move Conversation to Routing Flow
      • Quick Replies
      • Run Answer Flow
      • Start Conversation Chat Bot
      • Start Conversation
      • Send Link
      • Text Answer
      • Update Customer Identifier
    • Primitive Data Types
      • Any (JSON)
      • Asset
        • Detailed Asset
      • Boolean
      • Currency
      • Date
      • DateTime
      • Email
      • List
      • Null
      • Number
      • Phone
      • Text
      • Time
  • Transportation Products Catalog
    • The Transportation Products API
      • GET products
      • GET product-by-id
  • Release Notes
    • CXR Overview
    • CXR Upgrades and Migrations
Powered by GitBook
On this page
  • Overview and Discussion
  • Activity Variables
  • Activity Group Variables
  • Global Variables
  • Other Variable Types and Namespaces
  • Standard Journey Data
  • The Actor
  • Event Variables
  • Profile Variables
  • Theme Variables
  • Control Variables
  • Variables Outside a Journey
  • Data Flows

Was this helpful?

  1. Data and Integrations
  2. Working with Data

Variable Namespaces

PreviousWorking with DataNextStandard Session Data

Last updated 1 year ago

Was this helpful?

Overview and Discussion

All variables within a Journey have an associated namespace, which defines where the variable is stored, as well as how and when the variable is accessible. This places limitations on the scope of individual variables, which is important for the sake of both security and application efficiency.

Sometimes the namespace of a variable can be left implied; for instance, if you've worked with the Web Control to bind user input to an automatically-generated variable, then you already have experience working with a variable in the activity namespace – it's just that Activity Variables are so narrowly-scoped that the activity namespace can be left implicit.

Activity Variables are only accessible within a particular Activity (such as an individual Web Page or Decision Menu). This contrasts with Activity Group Variables, which are accessible within a whole Activity Group (such as a full Web Flow or a Voice Bot), and Global Variables, which are accessible throughout a Journey.

Each of these variable types is associated with a particular namespace:

  • Global Variables - found under the session namespace, as in a value must be referenced as session.value

    • Activity Group Variables - found under the activityGroup namespace, as in a value is referenced as activityGroup.value

      • **Activity Variables **- found under the activity namespace, though explicitly referencing it is optional.

Defining the namespace of a variable is a core part of variable creation. Sometimes this is done under the hood. For instance, the variable automatically created upon the addition of a Text Input Web Control is tied to the activity namespace as a matter of course. When you manually create a new variable, however, you need to define its namespace more explicitly.

For example, Global Variables, Activity Group Variables, and Activity Variables are all managed in the , which is found at the bottom left of the Studio regardless of which Builder you're in:

To create a new variable, open the Variable Tree and select the relevant type from the menu on the left:

Click on the '+' icon in the center menu and select the data type you want to associate with your new variable.

Once created, a variable can be edited in the center menu of the Variable Tree. The fields available for editing depend on the scope of the variable.

Activity Variables

Activity Variables are found under the the activity namespace. For example, an Activity Variable designated value would be referenced as:

activity.value

or simply as

value

because Activity Variables are so narrowly-scoped that the activity namespace can be left implied.

Editable fields in the Variable Tree

Once an Activity Variable has been created, the interface in the Variable Tree can be used to designate the variable's name and the Activity that the variable will be accessible within. The latter is done by first selecting the Activity Group that the Activity is a part of, and then selecting the Activity.

Activity Group Variables

Activity Group Variables are only accessible within a particular Activity Group, such as a Web Flow or a Voice Bot. They are found under the activityGroup namespace. For example, an Activity Group Variable designated value would be referenced as:

activityGroup.value

Depending on the nature of your application, you might have the option to leave the namespace implied, and reference this value as:

value

🚧 Unstated namespaces imply the narrowest relevant scope. When a namespace is unstated, Airkit will reference the available variable in the narrowest relevant scope. For instance, if you an Activity has access to both Activity Variable and an Activity Group Variable designated value, then referencing value within that Activity will return activity.value, not activityGroup.value. If you want to leave the activityGroup namespace implied, it is best practice to make sure none of your Activity Variables share a name with any of your Activity Group Variables.

Editable fields in the Variable Tree

Once an Activity Group Variable has been created, the interface in the Variable Tree can be used to designate both the variable's name and the Activity Group that the variable will be accessible within.

Global Variables

Global Variables are accessible throughout a Journey. They are found under the session namespace. For example, a Global Variable designated value would be referenced as:

session.value

Editable fields in the Variable Tree

Because Global Variables are available at any point throughout a Journey, there is no need to define their scope further. The only aspect of a Global Variable that can be edited in the Variable Tree is the Global Variable's designation.

Other Variable Types and Namespaces

Standard Journey Data

Every Journey automatically records standard data about the interface being used to access the application. This includes things like the timezone associated with the device and the dimensions of the web browser (if applicable). Standard Journey Data is collected in five different namespaces:

  • browser

  • session

  • journey

  • profile

  • channels

These namespaces are accessible at any point throughout a Journey.

The Actor

Information saved in the actor namespace is used to automatically establish omni-channel interactions with the users of your applications.

actor.phone

Event Variables

Event Variables are variables associated with and only accessible within a particular Event. They are accessible within the event namespace, although, because Event Variables are inherently small in scope, the event namespace is implied while working within an Event.

For example, say an Event is associated with the Event Variable value. Within the Event, this value can be called up either as

event.value

or simply as

value

Profile Variables

Profile Variables contain profile-level configuration variables. They are found under the profile namespace. For example, a Profile Variable designated value would be referenced as:

profile.value

Theme Variables

theme.brandPrimary

In doing so, future edits to brandPrimary in the Theme Builder will be automatically applied not just to your web app, but the associated Email Notification as well.

Control Variables

Custom Controls are customized Web Controls, made by combining out-of-the-box Web Controls into reusable elements. They can be made to reference internal variables, available only within the Custom Control. These internal variables are called Control Variables, and they are available on the control namespace. For example, if your Custom Control expects an input named value , then you would reference that variable within the Control as:

control.value

Variables Outside a Journey

All variables within a Journey have an associated namespace, but not everything created in the Studio is part of a Journey directly. In particular, Data Flows are connections that can be incorporated into a Journey, but they are not part of a Journey in and of themselves.

Data Flows

Data Flows are custom connections that are used to send, receive, and manipulate data.

Variables that exist within Data Flows can be conceptualized as existing in their own separate environment. They do not need an associated with a namespace because the only variables available within a Data Flow are its own. A variable designated value within a Data Flow would simple accessed as

value

within the Data Flow, and unaccessible in all other places.

When creating a Data Flow in the Connections Builder, all available variables will be tracked and displayed in the Inspector to the far right. These variables include both expected input, and internal variables generated in the process of running the Data Flow.

Activity Variables are only accessible within a particular Activity, such as an individual Web Page or Decision Menu. Variables that are automatically created to bind the data collected by Input Web Controls (such as the Control or the Control) are created as Activity Variables by default.

For more information on the values automatically stored in each namespace, see .

All Airkit apps come pre-generated with an empty Actor. The structure of the Actor is defined by the , which also comes pre-generated in every application and is accessible in .

The actor namespace is assessable at any point throughout a Journey. However, while the structure of the actor namespace is set automatically, the properties will be blank by default, and each one must be set explicitly. The variables stored in the actor namespace are locally-stored variables that can be assigned using the Action and referenced like any other locally variable. For instance, the phone property of the Actor is accessible as:

After a value has been assigned to a property in the actor namespace, the Action can be used to copy the relevant values into Airkit's actor_internal database. This is what allows Airkit to establish omni-channel communication with application users.

Because actor properties are used to automatically establish communication channels, their associated values must conform to expected formats. For more on the properties associated with the actor namespace and how they're used, see .

The details of defining and working with Event Variables depend on the nature of the Event. For instance, some Events, such as or can be customized such that they require input which can be manipulated as local variables within the Event. Other Events, such as , might generate variables in the process of being fired. For more information, see .

Each application contains different profiles. Each profile has a unique set of values and resources associated with them. For a deeper dive into profiles, see .

Some Profile Variables are a collected automatically, as discussed in the Standard Journey Data section above. It is also possible to create your own Profile Variable, allowing you to easily manage variables across different deployments. For more information, see .

The appearance of an application depends on the styling defaults defined in the . Themes keeps track of Variants, which are similar to CSS classes.

Airkit handles most of styling associated with Themes under the hood, but there are occasionally instances where it is useful to reference some styling element directly. For instance, the variable brandPrimary refers to a color code, which is automatically referenced in out-of-the-box Web Controls in order to keep the color palette of the application consistent. You might also want to reference this color code independently, such as when styling an email to send as a . In such cases, you would reference the color code stored to brandPrimary as:

For more on Custom Controls, see .

While they can be easily tied to Journeys, Data Flows exist outside of Journeys, and do not have direct access to a Journey's variables – not even the Journey's Global Variables. Instead, each Data Flow is defined to expect input, which is bound to variables that exist only locally within the Data Flow. If you want your Data Flow to have access to a variable associated with your Journey, you will need to explicitly give it to the Data Flow as input when calling on the Data Flow using the Action. For the purposes of direct testing in the , you will need to assign dummy values to all input variables.

For example, the following Inspector tracks the variables available within a Data Flow that takes a single text value (example input) as input and runs a single Data Operation, which returns the internal variable transform:

Once a variable is generated by a , it can be used in any number of downstream Data Operations.

For more on Data Flows, see .

Text Input
Phone Input
Standard Journey Data
Identity Object
AirData Builder
Set Variable
Initialize Actor
Actors
Session Events
Activity Group Events
Control Events
Events
Profiles and Deployment Settings
Tying Variables to Deployments
Theme Builder
Notification
Custom Controls
Run Data Flow
Connections Builder
Transform
Data Operation
Data Flows
Text Input
Variable Tree