Sources of select inputs
Learn how to configure sources for select components
Single select and multi select components allows to selecting options from a list. To configure options for your select inputs, select the component you want to update on Inputs tab and navigate to Source section on the right panel.
Click + Add new source to add new options for your single select and multi select input components.
Display and identifier values
Each option of a select component has a display and an identifier value.
Display value is an option's visible value. Identifier value is the corresponding value of display and it becomes the input's value when the action is run.
To get the entered or selected value of an team component, use below:
{{input.team}}
This returns the identifier value.
Generating sources for select inputs
Options of a select component can be generated from static and dynamic sources.
To set a select input with static values, add each option manually by providing display and identifier values.
To set a select input with dynamic sources, reference to the response of a request and generate an array of values to be the options of your component.
Let's take a closer look at configuring select inputs with static and dynamic values.
Static values
Below priority
input is a single select component configured with static values:
Display values are set as: Critical
, High
, Moderate
, Low
and Informational
Identifier values are set as: P1
, P2
, P3
, P4
and P5
While running the action, priority
input is displayed to users as below, prompting them to select between Critical
, High
, Moderate
, Low
and Informational
options.
Once the action is run, selected option's identifier value becomes the value of the input.
If Critical
option is selected, {{input.priority}}
returns P1
; which is the identifier value of the selected option.
Dynamic values
Most of the time, input values can be get from your applications. While configuring sources for select inputs, their options can be generated dynamically from request components.
Single select component configured with dynamic values:
Below groups
input is a single select component configured with dynamic values. The list of groups can be retrieved by sending an API request to Zendesk. Each group returning from ListGroups
request can be mapped as an option to the groups
input.
As seen, ListGroups
API request returns 2 groups: Billing
and Support
Inside double curly brackets, you can access components of your action and apply JavaScript methods to transform them.
→ Learn about using JavaScript in Actioner.
To get the names of each group and map them as an option to the groups
input, you can use below:
{{request.ListGroups.response.body.groups.map(group=>group.name)}})
To get the ids of each group and map them as an option to the groups
input, you can use below:
{{requests.ListGroups.response.body.groups.map(group=>group.id)}}
Group "name"s will be the display values and group "id"s will be the identifier values.
Display values are dynamically set as: Billing
, Support
Identifier values are dynamically set as: 4904679367709
, 4904561703069
While running the action, group
input is displayed to users as below, prompting them to select between Billing
or Support
.
IMAGE - Dynamic options of a single select component on action bar
While running the action, the selected option's identifier value becomes the value of the input.
If Billing
is selected, {{input.group}}
returns 4904679367709
; which is the identifier value of the selected option.