Skip to main content

Prompt Task Configuration (prompt)

Ask for user input

The prompt task type allows you to gather user input during the integration process.

Task Properties

PropertyTypeDescription
task"prompt", requiredSpecifies the task type, which should be set to "prompt" for this task.
namestringAn optional name for the task. If provided, the task state will be saved as a variable. Visit Task and Action States page to learn more.
labelstringAn optional label or description for the task.
whenobjectVisit Conditional Tasks and Actions page to learn how to execute task conditionally.
actionsArray<Action>, requiredAn array of action items that define the modifications to be made in the file.

Action Properties

PropertyTypeDescription
namestringAn optional name for the task. If provided, the task state will be saved as a variable. Visit Task and Action States page to learn more.
whenobjectVisit Conditional Tasks and Actions page to learn how to execute action conditionally.
text"text" or "boolean" or "multiselect", requiredThe text displayed to prompt the user.
typestring, requiredSpecifies the type of prompt to display.
messagestringA string that serves as the user prompt message when collecting input. If provided, this message will replace the default message.

The action item can take these properties based on which action you want to execute.

Text Prompt

PropertyTypeDescription
defaultValuestringThe value that is assigned if user does not enter any value.
initialValuestringThe initial text value.
placeholderstringThe hint text to be shown when user does not enter any value.
validateArray<Validation>Validates the user input before submission.

Validation Properties

PropertyTypeDescription
regexstring, requiredDisplays a yes/no confirmation for the user to choose from.
messagestringMessage to be displayed if validation fails.

Example:

task: prompt
actions:
- name: user_name
text: "Enter your name:"
validate:
- regex: ^[a-z0-9]+$
message: must contain only lowercase letters or numbers
- regex: ^[a-z]
message: must start with a letter

Boolean Prompt

PropertyTypeDescription
positivestringThe text to be displayed instead of 'yes'.
negativestringThe text to be displayed instead of 'no'.
initialValuebooleanDefault selection value.

Example:

task: prompt
actions:
- name: run_task
type: boolean
text: "Do you want to run this task?"

Multi Select Prompt

PropertyTypeDescription
requiredbooleanDefines that user must select at least one of select items.
optionsArray<Option>An array of options items.
initialValuesArray<string or boolean or number>Default selected values.

Option Properties

PropertyTypeDescription
valuestring or boolean or numberThe value of the option item
labelstringA text to be shown as label.
hintstringDisplays information about this option item.

Example:

task: prompt
actions:
- name: platforms
type: multiselect
required: true
text: "Select platforms to integrate:"
options:
- value: android
label: Android
hint: will integrate into android platform
- value: ios
label: iOS
hint: will integrate into iOS platform

Example

Here's an example of how to use prompts in a configuration file:

steps:
- task: prompt
actions:
- name: run_app_delegate
type: boolean
text: "Do you want to run the app_delegate task?"
- task: app_delegate
when:
run_app_delegate: true

In this example:

  • We define a boolean prompt to ask if the user wants to execute the task.
  • Within the app_delegate task, we check if the user confirmed to run the task.

The values entered by the user in response to prompts are stored as variables and can be referenced later in the configuration.