Data Messenger

Deliver the power of AutoQL to your users through Data Messenger, a state-of-the-art conversational interface you can easily build into your existing mobile application.

On this page:

About Data Messenger

Data Messenger is a conversational user interface (CUI). It is a flexible iOS widget that can be implemented and accessed within an existing application or software interface. Data Messenger enables users to interact conversationally with their data by entering natural language queries to receive information from their database (or more simply, allows users to ask questions in their own words to receive data-related responses).

Throughout this document, the words "Data Messenger" and "Widget" are used interchangeably. All widget components are open source, so Data Messenger is highly customizable in terms of both function and design.

Requirements

iOS 8 or later.

Setting Up Data Messenger

The following sections in this document contain detailed information about how to customize the properties of the widget.

Example

To run the example project, clone the repo, and run pod install from the Example directory first.

Installation

  1. Data Messenger is available through CocoaPods. To install it, begin by adding the following line to your Podfile:
pod 'chata'
  1. Next, add import autoql to your controller
import autoql
  1. Call DataMessenger()
let dataChat = DataMessenger(
authentication: authentication(
    apiKey: "YourApiKey",
    domain: "YourDomain",
    token: "YourToken"),
    projectID: "YoutProjectID")
  1. Show DataMessenger
dataChat.show(YourView)
// for access to props, use .config

dataChata.config.userDisplayName = "Chata"

Props

Prop NameData TypeDefault Value
isVisibleBooleantrue
placementstring: "Top" || "Bottom" || "Left" || "Right""Right"
titleString"Data Messenger"
userDisplayNameString"there"
introMessageString"Hi there! Let's dive into your data. What can I help you discover today?"
inputPlaceholderString"Type your queries here"
maxMessagesInt0
enableVoiceRecordBooleantrue
autoQLConfigAutoQLConfigAutoQLConfig()
dataFormattingDataFormattingDataFormatting()
themeString: "light" || "dark""light"
lightThemeColorString"#28A8E0"
darkThemeColorString"#525252"
aChartColorsArrayList<E>ArrayList()

isVisible: Determines whether the Bubble Handle view is visible on the screen or not.

//isChecked is a Boolean
bubbleHandle.isVisible = isChecked

placement: Determines the edge of the screen where Bubble Handle is placed.

//placement is an Integer
//config.placement = "Top" || "Bottom" || "Left" || "Right"

title: Text that appears in the header of the default Data Messenger view. You must provide an empty string if you do not want text to appear here, otherwise the default text (Data Messenger) will apply.

//title is a String
config.title = "Your Title"

userDisplayName: Name used in the intro message (example. "Hi Carlos!"). You can customize this value using names from your own database or identity implementation.

//userDisplayName is a String
config.userDisplayName = "Your Display Name"

introMessage: Customize the default intro message using your own brand voice and custom copy. The userDisplayName prop will be ignored if this is provided.

//introMessage is a String
config.introMessage = "Your intro Message"

inputPlaceholder: Customize the placeholder for the Query Input (natural language query search bar).

//inputPlaceholder is a String
config.inputPlaceholder = "Your input Placeholder"

maxMessages: Maximum number of messages that can be displayed in the Data Messenger interface at one time. A message is any input or any output in the interface. This means a query entered by a user constitutes one message, and the response returned in the Data Messenger interface constitutes another message. If a new message is added and you have reached the maximum, the oldest message will be erased.

//maxMessages is a Int
config.maxMessages = maxMessages

enableVoiceRecord: Enable the speech to text button.
Note: The speech to text function uses SpeechRecognizer which works when the "Manifest.permission.RECORD_AUDIO" permission is accepted by the user.

//enableVoiceRecord is a Boolean
config.enableVoiceRecord = enableVoiceRecord

theme: Color theme for Data Messenger. There are currently two options: light theme and dark theme. For a light theme, we will use 'light' and for a dark theme, we will use 'dark'.

//theme is a String "light" else "dark"
config.theme = theme

autoQLConfig Prop

KeyData TypeDefault Value
enableAutocompleteBooleantrue
enableQueryValidationBooleantrue
enableQuerySuggestionsBooleantrue
enableDrilldownsBooleantrue
enableColumnVisibilityManagerBooleantrue
debugBooleantrue

enableAutocomplete: Automatically populates similar query suggestions as users enter a query, so they get results more quickly and easily. If enabled, suggested queries will begin to appear above the Query Input bar as the user types.

//enableAutocomplete is a Boolean
config.autoQLConfig.enableAutocomplete = enableAutocomplete

enableQueryValidation: Catches and verifies references to unique data, so users always receive the data they need. If enabled, the natural language query entered by a user will first go through the validate endpoint. If the query requires validation (ex. the input contains reference to a unique nominal data), suggestions for that labeled data will be returned in a subsequent message, allowing the user to verify their input before executing their query.

//enableQueryValidation is a Boolean
config.autoQLConfig.enableQueryValidation = enableQueryValidation

For example: If you query, 'How much money does Carlos owe me?', validation may detect that there is no 'Carlos' label, but there are labels called 'Karlo', and 'carlo' in your database. The message will then let you select the appropriate label and run the corresponding query.

If this value is false, the query will bypass the validate endpoint and be sent straight to the query endpoint.

enableQuerySuggestions: Enables option for user to clarify meaning in cases where their original query lacked context or could be interpreted in multiple separate ways. If enabled, in cases where the query input was ambiguous, a list of suggested queries will be returned for the user to choose from, leading to more efficient and accurate responses. If this is false, a general error message will appear in its place.

//enableQuerySuggestions is a Boolean
config.autoQLConfig.enableQuerySuggestions = enableQuerySuggestions

enableDrilldowns: When a table or chart element is clicked by a user, a new query will run automatically, allowing the user to "drilldown" into the data to obtain a detailed breakdown of the figure returned by entry. If this is false, nothing will happen when a table or chart element is clicked.

//enableDrilldowns is a Boolean
config.autoQLConfig.enableDrilldowns = enableDrilldowns

enableColumnVisibilityManager: Column Visibility Manager allows the user to control the visibility of individual columns when query results are returned in a table. Users can access the Column Visibility Manager to adjust their visibility preferences by clicking the "eye" icon in the Options Toolbar and selecting or deselecting columns. Once set, visibility preferences will be persisted. Any future query containing columns that were previously shown or hidden by the user will also reflect these changes. The user can access the Column Visibility Manager to make changes to these visibility preferences at any time.

//enableColumnVisibilityManager is a Boolean
config.autoQLConfig.enableColumnVisibilityManager = enableColumnVisibilityManager

dataFormatting Prop

KeyData TypeDefault Value
currencyCodeString"USD"
languageCodeString"en-US"
currencyDecimalsInt2
quantityDecimalsInt1
monthYearFormatString"MMM YYYY"
dayMonthYearFormatString"MMM DD, YYYY"

currencyCode: If your data is not in USD, you can specify a different ISO 4217 currency code here. All visualizations (tables and charts) will show the default currency formatting for the specified code.

//currencyCode is a String
config.dataFormatting.currencyCode = currencyCode

languageCode: If the currency code from your country requires letters not contained in the English alphabet, set this to the appropriate IETF language tag to import the necessary characters.

//languageCode is a String
config.dataFormatting.languageCode = languageCode

currencyDecimals: Number of digits to display after a decimal point for currencies.

//currencyDecimals is an Integer
config.dataFormatting.currencyDecimals = currencyDecimals

quantityDecimals: Number of digits to display after a decimal point for quantity values.

//quantityDecimals is a Int
config.dataFormatting.quantityDecimals = quantityDecimals

monthYearFormat: The format to display the representation of a whole month. AutoQL uses SimpleDateFormat("format", Locale.US). Reference can be found here.

//monthYearFormat is a String
config.dataFormatting.monthYearFormat = monthYearFormat

dayMonthYearFormat: The format to display the representation of a single day. (ie. March 18, 2020). AutoQL uses SimpleDateFormat("format", Locale.US). Reference can be found here.

//dayMonthYearFormat is a String
config.dataFormatting.dayMonthYearFormat = dayMonthYearFormat