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 type | Syntax | Example |
---|---|---|
Text | input.text | "Sample text" |
Text area | input.textArea | "This is a long text" |
input.email | "example@example.com" | |
Link | input.link | "https://example.com" |
Phone number | input.phoneNumber | "+1 123-456-7890" |
Integer | input.integer | 42 |
Decimal | input.decimal | 3.14 |
Single select | input.singleSelect | "Option A" |
Multi select | input.multiSelect | ["Option A","Option B"] |
Checkbox | input.checkbox | true |
Checkbox group | input.checkboxGroup | ["Option A","Option B"] |
Radio button | input.radioButtonGroup | "Option A" |
Date | input.date | "2023-07-24" |
Time | input.time | "14:00" |
Date & time | input.dateTime | 1690207200000 |
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.
To learn how to enable type ahead functionality for your select inputs, visit Search property in select fields page.
Input type | Syntax | Description |
---|---|---|
Single select | input.singleSelect.query | Returns the typed value in the single select field. |
Multi select | input.multiSelect.query | Returns 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 component | Syntax | Description |
---|---|---|
Event body | event.body.users | Returns users in the body of your trigger event. |
Event headers | event.headers.authorization | Returns the authorization value in the header of your trigger event. |
Event parameters | event.params.query | Returns 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 type | Syntax | Description |
---|---|---|
Action | nodes.action0.response | Returns the response of action0 . |
Condition | nodes.condition0.conditionMatched | Returns true or false , indicating whether condition0 was matched. |
Loop | nodes.loop0.iterationCount | Returns the current iteration count of loop0 . |
Loop | nodes.loop0.item | Returns the current item in the iteration of loop0 . |
Loop | nodes.loop0.size | Returns the total number of items in loop0 . |
Response | nodes.response0.response | Returns the response of response0 . |
Workflow | nodes.workflow0.response | Returns the response of workflow0 . |
Q&A | nodes.qA0.response.answer | Returns the answer field in response of qA0 . |
Workflow resolver | nodes.workflowResolver0.response.workflowName | Returns workflowName of the identified workflow based on the given content. |
Workflow resolver | nodes.workflowResolver0.response.workflowId | Returns workflowId of the workflow. |
Workflow resolver | nodes.workflowResolver0.response.matchScore | Returns the matchScore of workflowResolver0 . |
Workflow resolver | nodes.workflowResolver0.response.appId | Returns appId of the workflow. |
Workflow resolver | nodes.workflowResolver0.response.parameterNames | Returns the list of parameterNames in the workflow. |
Workflow resolver | nodes.workflowResolver0.response.parameterValues | Returns the list of parameterValues generated for the workflow. |
Workflow resolver | nodes.workflowResolver0.response.hasMissingParameterValues | Returns true or false , indicating whether response from workflowResolver0 contains any missing parameter values. |
Workflow resolver | nodes.workflowResolver0.response.allMandatoryParametersAreSatisfied | Returns 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.
The only way to add data to your workflow's context is through adding a function. context.put()
will not work while writing expressions.
Usage | Syntax | Description |
---|---|---|
Adding data to context | context.put('key','value') | Incorporates a new key into the context object with the corresponding value . |
Retrieving data from context | context.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 App config 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.
Visit App config page to learn more.
Usage | Syntax | Description |
---|---|---|
Retrieving data from config | config.preferences | Retrieves preferences config JSON. |
Retrieving data of a specific propery | config.preferences.sendDM | Retrieves sendDM property in preferences config. |
User
The user
variable provides information about the user who executed the workflow. It contains two properties:
Property | Syntax | Description |
---|---|---|
User ID | user.id | Returns the ID of the user who executed the workflow. This is the ID associated with the user in Actioner. |
user.email | Returns 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.
The slack
variable is only available when the workflow is run in Slack by clicking a button.
Property | Syntax | Description |
---|---|---|
Channel ID | slack.channel.id | Returns the ID of the Slack channel where the workflow was triggered. |
Channel name | slack.channel.name | Returns the name of the Slack channel where the workflow was triggered. |
Team ID | slack.team.id | Returns the ID of the Slack team where the workflow was triggered. |
Message | slack.message.text | Returns the text content of the message where the workflow was triggered. |
User ID | slack.message.user | Returns the ID of the Slack user who sent the message. |
App ID | slack.message.app_id | Returns the ID of the Slack app that sent the message. |
Bot ID | slack.message.bot_id | Returns the ID of the Slack bot that sent the message. |
Timestamp | slack.message.ts | Returns the timestamp of the message where the workflow was triggered. |
Thread timestamp | slack.message.thread_ts | Returns the timestamp of the parent message. |
User ID | slack.user.id | Returns the ID of the Slack user who executed the workflow by clicking the button. |
User name | slack.user.name | Returns 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 type | Syntax | Description |
---|---|---|
Table | currentItem.fieldName | Returns fieldName in the matching item of the table source. |
Key value table | currentItem.fieldName | Returns fieldName from the table source. |
Bar chart | currentItem.id | Returns id in the matching item of the chart source. |
Pie chart | currentItem.id | Returns id in the matching item of the chart source. |
App
The app
variable provides information about the app that the workflow is part of.
Property | Syntax | Description |
---|---|---|
App ID | app.id | Returns 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.
Property | Syntax | Description |
---|---|---|
Workspace Subdomain | workspace.subdomain | Returns 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 type | Property | Syntax | Description |
---|---|---|---|
Bitbucket (OAuth2) | External ID | auth.externalId | Returns the external ID of the Bitbucket connection. |
GitHub (OAuth2) | External ID | auth.externalId | Returns the external ID of the GitHub connection. |
GitLab (OAuth2) | External ID | auth.externalId | Returns the external ID of the GitLab connection. |
HubSpot (OAuth2) | External ID | auth.externalId | Returns the external ID of the the connection. |
HubSpot (OAuth2) | Company currency | auth.companyCurrency | Returns the company currency of the connected HubSpot account. |
HubSpot (OAuth2) | Time zone | auth.timeZone | Returns the time zone of the connected HubSpot account. |
Jira (OAuth2) | Cloud ID | auth.cloudId | Returns the cloud ID of the connected Jira instance. |
Jira (OAuth2) | Jira Site URL | auth.jiraSiteUrl | Returns the site URL of the connected Jira instance. |
JSM (OAuth2) | Cloud ID | auth.cloudId | Returns the cloud ID of the connected JSM instance. |
JSM (OAuth2) | Jira Site URL | auth.jsmSiteUrl | Returns the site URL of the connected JSM instance. |
PagerDuty (OAuth2) | External ID | auth.externalId | Returns 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.
Type | Syntax | Description | Example method |
---|---|---|---|
Array operations | arrayUtils.method(...params) | Utilize array operations and manipulations using methods from the arrayUtils library. | arrayUtils.filter(Array, item => item > 5) |
Collection manipulation | collectionUtils.method(...params) | Perform manipulations on collections using methods from the collectionUtils library. | collectionUtils.map(collection, item => item * 2) |
Date manipulation | dateUtils.method(...params) | Perform various date manipulation operations using methods from the dateUtils library. | dateUtils.format(DateObject, 'yyyy-MM-dd') |
Function utilities | functionUtils.method(...params) | Enhance your workflow with function utility methods from the functionUtils library. | functionUtils.memoize(func) |
Language utilities | langUtils.method(...params) | Make use of language utility methods for various operations using langUtils library. | langUtils.startsWith(string, 'Hello') |
Math functions | mathUtils.method(...params) | Perform mathematical operations using the methods available in mathUtils library. | mathUtils.subtract(a, b) |
Number operations | numberUtils.method(...params) | Apply various number-related operations using numberUtils library methods. | numberUtils.multiply(a, b) |
Object manipulation | objectUtils.method(...params) | Manipulate objects with ease using methods from the objectUtils library. | objectUtils.get(object, 'property.path') |
String manipulation | stringUtils.method(...params) | Perform string-related operations efficiently using stringUtils library methods. | stringUtils.trim(' Hello, world! ') |
Utilities | utils.method(...params) | Access general utility methods for your workflow needs using utils library. | utils.isEmpty([]) |
Zoned date utilities | zonedDateUtils.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.
Method | Syntax | Description |
---|---|---|
atob | atob(encodedString) | Convert a base64-encoded string to its original text representation. |
btoa | btoa(text) | Convert text to its base64-encoded representation. |
htmlToMarkdown | htmlToMarkdown(htmlText) | Convert HTML-formatted text to Markdown format. |
markdownToHtml | markdownToHtml(markdownText) | Convert Markdown-formatted text to HTML format. |
yamlToJson | yamlToJson(yamlText) | Convert YAML-formatted text to JSON format. |