Create Survey that Starts a Workflow
Esta página aún no se encuentra traducida al español.
Tutorial on setting up a channel with a task creation button.
Time: 30 minutes
Company Requirements
Let's continue the tutorial with our mock company, Ruanda. Two tutorials ago, we started making a task manager and then we saw how to create tasks from within the task view. The company liked the demo, but they want to know if there's an easier way for users to create tasks. In this section, we'll see how to create a task using a survey associated with a bot.
Pre-Requisites
Access Role
- User with the
admin-statemachines-write
,admin-bots-write
,admin-properties-write
, andadmin-groups-write
permissions to create and modify workflows, bots, proeperties, and groups. - Or
admin-*-write
which allows all of the above. - User with the
full admin
access role.
Database
- Having completed the Create Collection Tutorial.
- Have the Department collection still activated.
Workflow
Having completed the Create a Worflow Tutorial.
Have the Task Manager workflow-group still activated.
Copy either the workflow-group's id number or its code.
note- The id can be obtained by copying the number that appears in the URL when accessing the Task Manager workflow-group.
- The code can be obtained from Task Manager workflow-group's settings panel.
- Be sure to respectively replace the -group id- or the -group code- tags used in this tutorial with the id or code you retrived from your computer.
Survey
- Having completed the Create Survey Tutorial
Steps
I. Create the Survey Form
Create a collection for the survey.
- Go to Admin, then Database.
- Press the + icon to create a new collection.
- Configure and save the collection with the following settings:
- Name:
Task creator survey
- Code:
task_creator_survey
- Name:
Create an element in the collection.
- From within the collection's settings panel, press the + icon to create a new element.
- Configure and save the new element with the following settings:
- Name:
Create task form
- Code:
create_task_form
- Name:
Create the survey.
Go to Administrator, then Surveys.
Press the + icon to create a new form.
Configure and save the new form with the following settings:
- In General information, set:
- Name:
Create task
- Code:
task_creator_00
- Name:
- In Access, set:
- Group permission:
Task Manager
- Access roles:
default
- In Channel properties, press the + Add Element button, and set:
- Collection:
Task creator survey
- Elements:
Create task form
- Collection:
- Group permission:
- In General information, set:
From the Form Template section, set up the form:
- From the Components column, drag and drop the Written Answer component to the form template and fill the fields with the following:
- Field label:
Name of the Task
- Identifier:
nametask_00
- Field label:
- From the Components column, drag and drop the Written Answer component to the form template and fill the fields with the following:
- Field label:
Long Description of the Task
- Identifier:
descriptiontask_00
- Field label:
- From the Components column, drag and drop the Multiple choice component to the form template and fill the fields with the following:
- Field label:
Department
- Identifier:
departmenttask_00
- Type:
Collection
- Collection:
Department
- Field label:
- From the Components column, drag and drop the Multiple choice component to the form template and fill the fields with the following:
- Field label:
Importance
- Identifier:
importancetask_00
- Type:
Collection
- Collection:
Task-Importance
- Field label:
- From the Components column, drag and drop the Written Answer component to the form template and fill the fields with the following:
The collections mentioned were to be created during previous tutorials and might differ from the ones found in your session.
Press Save.
Before saving, your screen should look something like this:

II. Create the Bot
- Go to Administrator and open Bots.
- Press the + icon to create a new bot.
Configure the new bot with the following settings:
- In General information, set:
- Name:
Create task bot
- User bot name:
create_task_bot
- Description:
Creates bot through survey.
- Name:
- In Access, set:
- Access Roles:
full admin
- Access Roles:
In Functions, set:
- It's a survey command: activated
- Form:
Create Task
noteThis is the survey we created in the previous step.
Your screen should look something like this:
- In General information, set:

Build the routine:
- In Routine Builder, press + Add Routine.
The following panel will show up:
- Then, press + Add Stage and set the following:
- Code:
create_task
- Type:
Create Task
- Code:
Your screen should now look something like this:
Also set the following:
In the Name field, press + Add Item, then set:
- Item:
$VALUE#data|[find=>identifier=nametask_00]|process|0
note- We use Cotlang script to retrieve the task's name from the entered survey.
- Notice how we use
nametask_00
to reference the survey's Name of the Task field.
- Item:
- Group:
($CODE#group#code#group-code)|_id
IMPORTANT!- Replace
group-code
with your Task Manager workflow-group's code. - Or, instead of using this Cotlang script, you may also insert the Task Manager's id number which can be obtained from its URL.
- Replace
- User:
$VALUE#user
noteThis Cotlang script will get the person who filled out the survey.
- In Answers, press + Add Item, then set:
- Item:
$VALUE#uuid
- Item:
- Dynamic Field 1:
$VALUE#data|[find=>identifier=importancetask_00]|process|0
note- We use Cotlang script to retrieve the task's level of importance which was entered in the survey.
- Notice how we use
importancetask_00
to reference the survey's Importance field.
- Dynamic Field 2:
$VALUE#data|[find=>identifier=departmenttask_00]|process|0
note- We use Cotlang script to retrieve the department assigned to the task.
- Notice how we use
departmenttask_00
to reference the survey's Department field.
In Assignee, press + Add Item, then set:
- Item:
$VALUE#user
noteThe user who filled out the survey will be posted as the assignee.
- Item:
In Information, set:
- Information:
$VALUE#data|[find=>identifier=descriptiontask_00]|process|0
note- We use Cotlang script to retrieve the Long Description of the Task which was entered in the survey.
- Notice how we use
descriptiontask_00
to reference the survey's Importance field. - The description will be placed in the task's additional information field.
- Information:
Go to the top of the Routine builder section, under Stage, General Information, set:
- Initial Stage:
create_task
- Max. Iterations:
10
The top of the Routine builder section looks like this:
- Initial Stage:

- Press Save.
III. Create Channel Associated with Survey and Bot
- Access the Administrator and open Workflow.
- Press the Task Manager workflow-group's channels list icon.
Look for the following icon and press it:

The Task Manager's Channels settings panel will open up and might look something like this:

Press + icon to create a new channel and set it as follows:
- In General information, set:
- Name:
Create Task
- Code:
create_task_channel
- Name:
- In Participants, set:
- User: Add all the users of the company
- Bots: Create task bot
- In Elements, do the following:
- Press + Add Element, set:
- Collection:
Task creator survey
- Elements:
Create task form
- Collection:
- Press + Add Element, set:
- In Options, set:
- Permission for sending messages:
None
- Permission for sending messages:
Your screen should now look similar to this:
- In General information, set:

- Press Save.
IV. Workflow Configuration
- Access the Administrator and open Workflows.
Press the Task Manager group.
Follow the image below:

Press the Task Manager Flow workflow.
Follow the image below:

In General Information, set:
- Chat channels:
UNBOUND
Follow the image below:
- Chat channels:

- Press Save.
You did it!
Now go to the Task Manager's Create Task channel to create your first task!

Result
Once you create your first tasks, the Task Manager workflow-group, with its Create Task channel and Task Creator survey button, should look something like the following image:

In the following image, we see the task view with tasks created using the survey. You should see similar results:
