Saltar al contendio prinicipal

Create Survey that Starts a Workflow

Advertencia

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, and admin-groups-write permissions to create and modify workflows, bots, proeperties, and groups.
  • Oradmin-*-write which allows all of the above.
  • User with the full admin access role.

Database

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

Steps

I. Create the Survey Form

  1. Create a collection for the survey.

    1. Go to Admin, then Database.
    2. Press the + icon to create a new collection.
    3. Configure and save the collection with the following settings:
      • Name: Task creator survey
      • Code: task_creator_survey

  1. Create an element in the collection.

    1. From within the collection's settings panel, press the + icon to create a new element.
    2. Configure and save the new element with the following settings:
      • Name: Create task form
      • Code: create_task_form

  1. Create the survey.

    1. Go to Administrator, then Surveys.

    2. Press the + icon to create a new form.


  1. Configure and save the new form with the following settings:

    1. In General information, set:
      • Name: Create task
      • Code: task_creator_00

    1. 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

  1. From the Form Template section, set up the form:

    1. 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

    1. 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

    1. 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

    1. 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
note

The collections mentioned were to be created during previous tutorials and might differ from the ones found in your session.


  1. Press Save.

    Before saving, your screen should look something like this:

form

II. Create the Bot

  1. Go to Administrator and open Bots.

  1. Press the + icon to create a new bot.

  1. Configure the new bot with the following settings:

    1. In General information, set:
      • Name: Create task bot
      • User bot name: create_task_bot
      • Description: Creates bot through survey.

    1. In Access, set:
      • Access Roles: full admin

    1. In Functions, set:

      • It's a survey command: activated
      • Form: Create Task
      note

      This is the survey we created in the previous step.

    Your screen should look something like this:

bot settings 1

  1. Build the routine:

    1. In Routine Builder, press + Add Routine.

    The following panel will show up:

    Routine Builder

    1. Then, press + Add Stage and set the following:
      • Code: create_task
      • Type: Create Task

    Your screen should now look something like this:

    Stage

    1. 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.

      • 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.

      • User: $VALUE#user
        note

        This Cotlang script will get the person who filled out the survey.


      • In Answers, press + Add Item, then set:
        • Item: $VALUE#uuid

      • 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
        note

        The user who filled out the survey will be posted as the assignee.


      • 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.

  1. Go to the top of the Routine builder section, under Stage, General Information, set:

    1. Initial Stage: create_task
    2. Max. Iterations: 10

    The top of the Routine builder section looks like this:

routine builder settings

  1. Press Save.

III. Create Channel Associated with Survey and Bot

  1. Access the Administrator and open Workflow.

  1. Press the Task Manager workflow-group's channels list icon.

Look for the following icon and press it:

channel list icon

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

workflow group channel

  1. Press + icon to create a new channel and set it as follows:

    1. In General information, set:
      • Name: Create Task
      • Code: create_task_channel

    1. In Participants, set:
      • User: Add all the users of the company
      • Bots: Create task bot

    1. In Elements, do the following:
      • Press + Add Element, set:
        • Collection: Task creator survey
        • Elements: Create task form

    1. In Options, set:
      • Permission for sending messages: None

    Your screen should now look similar to this:

Channel settings

  1. Press Save.

IV. Workflow Configuration

  1. Access the Administrator and open Workflows.

  1. Press the Task Manager group.

    Follow the image below:

task manager

  1. Press the Task Manager Flow workflow.

    Follow the image below:

task manager

  1. In General Information, set:

    • Chat channels: UNBOUND

    Follow the image below:

task manager

  1. Press Save.

You did it!

Now go to the Task Manager's Create Task channel to create your first task!

create task channel

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:

task manager group

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

task view