Skip to main content

Built-in variables and methods

Learn about using built-in variables and methods in Actioner.


Actioner provides built-in methods and variables for working with data. These provide support for:

  • Accessing specific data
  • Using data in your workflow executions
  • Convenience variables to help with data
  • Accessing data in your apps and connections

This document provides a reference list of available variables and methods.

Inputs

The input variable is reserved for manual workflows. To retrieve the value of a specific input during workflow execution, use the notation input.myInput, where myInput represents the ID of the input.

Input typeSyntaxExample
Textinput.text"Sample text"
Text areainput.textArea"This is a long text"
Emailinput.email"example@example.com"
Linkinput.link"https://example.com"
Phone numberinput.phoneNumber"+1 123-456-7890"
Integerinput.integer42
Decimalinput.decimal3.14
Single selectinput.singleSelect"Option A"
Multi selectinput.multiSelect["Option A","Option B"]
Checkboxinput.checkboxtrue
Checkbox groupinput.checkboxGroup["Option A","Option B"]
Radio buttoninput.radioButtonGroup"Option A"
Dateinput.date"2023-07-24"
Timeinput.time"14:00"
Date & timeinput.dateTime1690207200000
Mapinput.map{ "key1": "value1", "key2": "value2" }

Query property for search-as-you-type inputs

Adding query after referencing to your inputs let you retrieve the typed value in your select inputs where Search option is enabled.

Tip

To learn how to enable type ahead functionality for your select inputs, visit Search property in select fields page.

Input typeSyntaxDescription
Single selectinput.singleSelect.queryReturns the typed value in the single select field.
Multi selectinput.multiSelect.queryReturns the typed value in the multi select field.

Events

The event variable is reserved for automated workflows. Automated workflows are initiated by receiving data from a webhook. They can start with a webhook trigger or a trigger from an integration.

To access the data in your events during workflow execution, use the notation event.

Event componentSyntaxDescription
Event bodyevent.body.usersReturns users in the body of your trigger event.
Event headersevent.headers.authorizationReturns the authorization value in the header of your trigger event.
Event parametersevent.params.queryReturns the query parameter value in your trigger event.

Nodes

The nodes variable is used for accessing the result of executions of earlier nodes in your workflows.

Node typeSyntaxDescription
Actionnodes.action0.responseReturns the response of action0.
Conditionnodes.condition0.conditionMatchedReturns true or false, indicating whether condition0 was matched.
Loopnodes.loop0.iterationCountReturns the current iteration count of loop0.
Loopnodes.loop0.itemReturns the current item in the iteration of loop0.
Loopnodes.loop0.sizeReturns the total number of items in loop0.
Responsenodes.response0.responseReturns the response of response0.
Workflownodes.workflow0.responseReturns the response of workflow0.
Q&Anodes.qA0.response.usedInformationReturns the usedInformation in response of qA0.
Q&Anodes.qA0.response.answerReturns the answer in response of qA0.
Workflow resolvernodes.workflowResolver0.response.workflowNameReturns workflowName of the identified workflow based on the given content.
Workflow resolvernodes.workflowResolver0.response.workflowIdReturns workflowId of the workflow.
Workflow resolvernodes.workflowResolver0.response.matchScoreReturns the matchScore of workflowResolver0.
Workflow resolvernodes.workflowResolver0.response.appIdReturns appId of the workflow.
Workflow resolvernodes.workflowResolver0.response.parameterNamesReturns the list of parameterNames in the workflow.
Workflow resolvernodes.workflowResolver0.response.parameterValuesReturns the list of parameterValues generated for the workflow.
Workflow resolvernodes.workflowResolver0.response.hasMissingParameterValuesReturns true or false, indicating whether response from workflowResolver0 contains any missing parameter values.
Workflow resolvernodes.workflowResolver0.response.allMandatoryParametersAreSatisfiedReturns true or false, indicating whether response from workflowResolver0 returns values of all mandatory parameters.

Context

context is a JSON object that stores the state of data during workflow execution. It is dynamically built as a collection of key-value pairs, where each unique key is associated with a value, which can be a string, number, boolean, array, or map.

context object is produced whenever your workflow is run. The context is built incrementally through each node of the workflow and is destroyed when the last node is executed.

Tip

The only way to add data to your workflow's context is through adding a function. context.put() will not work while writing expressions.

UsageSyntaxDescription
Adding data to contextcontext.put('key','value')Incorporates a new key into the context object with the corresponding value.
Retrieving data from contextcontext.get('key')
context.key
key
Retrieves the value associated with the specified key from the context object.

Config

The config variable allows you to access and modify your app's settings and behavior defined on Configs tab. This enables storing parameters and preferences, enhancing the flexibility and customization of your app. Data in your app's config are stored in JSON format.

Tip

Visit Config page to learn more.

UsageSyntaxDescription
Retrieving data from configconfig.preferencesRetrieves preferences config JSON.
Retrieving data of a specific properyconfig.preferences.sendDMRetrieves sendDM property in preferences config.

User

The user variable provides information about the user who executed the workflow. It contains two properties:

PropertySyntaxDescription
User IDuser.idReturns the ID of the user who executed the workflow. This is the ID associated with the user in Actioner.
Emailuser.emailReturns the email of the user who executed the workflow. This is the email address associated with the user in Actioner.

Slack

The slack variable provides information about the Slack context when a workflow is run in Slack by clicking a button. This context includes details about the channel, team, message, user, and other related information.

Tip

The slack variable is only available when the workflow is run in Slack by clicking a button.

PropertySyntaxDescription
Channel IDslack.channel.idReturns the ID of the Slack channel where the workflow was triggered.
Channel nameslack.channel.nameReturns the name of the Slack channel where the workflow was triggered.
Team IDslack.team.idReturns the ID of the Slack team where the workflow was triggered.
Messageslack.message.textReturns the text content of the message where the workflow was triggered.
User IDslack.message.userReturns the ID of the Slack user who sent the message.
App IDslack.message.app_idReturns the ID of the app for Slack that sent the message.
Bot IDslack.message.bot_idReturns the ID of the Slack bot that sent the message.
Timestampslack.message.tsReturns the timestamp of the message where the workflow was triggered.
Thread timestampslack.message.thread_tsReturns the timestamp of the parent message.
User IDslack.user.idReturns the ID of the Slack user who executed the workflow by clicking the button.
User nameslack.user.nameReturns the name of the Slack user who executed the workflow by clicking the button.

Current item in outputs

The currentItem variable refers to the matching item in the table or chart source.

Output typeSyntaxDescription
TablecurrentItem.fieldNameReturns fieldName in the matching item of the table source.
Key value tablecurrentItem.fieldNameReturns fieldName from the table source.
Bar chartcurrentItem.idReturns id in the matching item of the chart source.
Pie chartcurrentItem.idReturns id in the matching item of the chart source.

App

The app variable provides information about the app that the workflow is part of.

PropertySyntaxDescription
App IDapp.idReturns the ID of the app that the workflow is part of.

Workspace

The workspace variable provides information about the Actioner workspace from which the workflow is run.

PropertySyntaxDescription
Workspace Subdomainworkspace.subdomainReturns the name of the Actioner subdomain from which the workflow is run.

Auth

The auth variable returns parameters specific to different connection types when a workflow is run. This context includes details about the authentication data.

Connection typePropertySyntaxDescription
Bitbucket (OAuth2)External IDauth.externalIdReturns the external ID of the Bitbucket connection.
GitHub (OAuth2)External IDauth.externalIdReturns the external ID of the GitHub connection.
GitLab (OAuth2)External IDauth.externalIdReturns the external ID of the GitLab connection.
HubSpot (OAuth2)External IDauth.externalIdReturns the external ID of the the connection.
HubSpot (OAuth2)Company currencyauth.companyCurrencyReturns the company currency of the connected HubSpot account.
HubSpot (OAuth2)Time zoneauth.timeZoneReturns the time zone of the connected HubSpot account.
Jira (OAuth2)Cloud IDauth.cloudIdReturns the cloud ID of the connected Jira instance.
Jira (OAuth2)Jira Site URLauth.jiraSiteUrlReturns the site URL of the connected Jira instance.
JSM (OAuth2)Cloud IDauth.cloudIdReturns the cloud ID of the connected JSM instance.
JSM (OAuth2)Jira Site URLauth.jsmSiteUrlReturns the site URL of the connected JSM instance.
PagerDuty (OAuth2)External IDauth.externalIdReturns the external ID of the PagerDuty connection.

Utility methods for workflows

This section provides a set of helper JS methods to access and manipulate data in your workflows.

TypeSyntaxDescriptionExample method
Array operationsarrayUtils.method(...params)Utilize array operations and manipulations using methods from the arrayUtils library.arrayUtils.filter(Array, item => item > 5)
Collection manipulationcollectionUtils.method(...params)Perform manipulations on collections using methods from the collectionUtils library.collectionUtils.map(collection, item => item * 2)
Date manipulationdateUtils.method(...params)Perform various date manipulation operations using methods from the dateUtils library.dateUtils.format(DateObject, 'yyyy-MM-dd')
Function utilitiesfunctionUtils.method(...params)Enhance your workflow with function utility methods from the functionUtils library.functionUtils.memoize(func)
Language utilitieslangUtils.method(...params)Make use of language utility methods for various operations using langUtils library.langUtils.startsWith(string, 'Hello')
Math functionsmathUtils.method(...params)Perform mathematical operations using the methods available in mathUtils library.mathUtils.subtract(a, b)
Number operationsnumberUtils.method(...params)Apply various number-related operations using numberUtils library methods.numberUtils.multiply(a, b)
Object manipulationobjectUtils.method(...params)Manipulate objects with ease using methods from the objectUtils library.objectUtils.get(object, 'property.path')
String manipulationstringUtils.method(...params)Perform string-related operations efficiently using stringUtils library methods.stringUtils.trim(' Hello, world! ')
Utilitiesutils.method(...params)Access general utility methods for your workflow needs using utils library.utils.isEmpty([])
Zoned date utilitieszonedDateUtils.method(...params)Make use of zoned date utilities with methods from the zonedDateUtils library.zonedDateUtils.addDays(date, 5)

Other helper methods

This section provides additional methods to access and manipulate data in your workflows.

MethodSyntaxDescription
atobatob(encodedString)Convert a base64-encoded string to its original text representation.
btoabtoa(text)Convert text to its base64-encoded representation.
htmlToMarkdownhtmlToMarkdown(htmlText)Convert HTML-formatted text to Markdown format.
markdownToHtmlmarkdownToHtml(markdownText)Convert Markdown-formatted text to HTML format.
yamlToJsonyamlToJson(yamlText)Convert YAML-formatted text to JSON format.