Create skill with forms

Last Updated: 25.10.2019

For example, in your organization, you have a process for ordering new equipment, like computers, phones, printers, etc. And you have a Form that employees should fill out and then send to the IT department. With Hala, you can provide a Form to the user, grab the results, and then provide this information to the responsible people.

Step 1. At first, you need to create an intent to recognize the user input about the ordering equipment. Go to the Intents section on the Hala Platform and press New Utterance

Step 2. To change the default name of the intent, click on icon pencil next to the default value, or you can click on the default value, and then you will be able to modify it.

Step 3. Specify the name of the intent and press Enter

Step 4. Now you need to provide examples of how the end-users can write about suspicious emails. You need to provide at least five examples.

Step 5. Save your changes and train model

Step 6. Go to the Skill Kit section on the Hala Platform and create a skill by pressing the button Create skill

Step 7. Provide the name of the skill, description, and tags (last two is optional). Press next for creating the dialog flow.

Step 8. You will be promoted to the interface for creation dialog flow. Create the first root node by pressing the button Add new

Step 9. Open the created dialog node and fill it.

  • Field Name - you can enter any value, for example "Get question from the user"

  • Conditions - here you need to specify created intent intent.order_hardware

  • Actions - skip this section

  • Context - skip this section

  • Output - in output we can specify the answer from Hala that will include the Form.

You can use the expert mode to add the forms. The expert mode becomes available by pressing the button next to the word "Output." More about information about the adding Forms you can find here.

Access the Expert mode

Here is the example of JSON format for the forms:

{
"type": "form",
"title": "Order Computers/Printers/Telephones",
"formData": [
{
"key": "device",
"type": "select",
"label": "Device",
"value": "",
"options": [
"Mobile",
"Laptop",
"Asus",
"Dell 1000 PC"
],
"description": ""
},
{
"key": "forUser",
"type": "select",
"label": "User",
"value": "",
"options": [
"Andrii Rudchuk",
"Mykyta Bazhenov"
],
"description": ""
},
{
"key": "reason",
"type": "text",
"label": "Provide the business reason for ordering new hardware",
"value": "",
"optimal": false,
"suggestion": {
"title": "Common values",
"options": [
"New joiner",
"New employee in Finance Department"
]
}
}
],
"showFilter": false
}

When you will add this information you will have something like this:

Step 10. Now you need to create child nodes to handle the form results. You need to create at least two child nodes. One child node will be triggered in case user will Save the form, the second child node will be triggered in case the user will press Cancel

After the creating two child nodes you will see the next tree:

Step 11. Open the first child node and fill it.

  • Field Name - you can enter any value, for example "Form Success"

  • Conditions - here you need to specify the system condition context.formResult

  • Actions - skip this section

  • Context - skip this section

  • Output - in output you can enter the next text:

Thank you for submitting the form.
Here are the details of your order:
Device: {{context.formResult.device}}
Deliver to: {{context.formResult.forUser}}
Reason: {{context.formResult.reason}}
How can I help you else?

Here is your output:

Step 12. Open the second child node that you have created and fill it.

  • Field Name - you can enter any value, for example "Form Canceled"

  • Conditions - here you need to specify the system condition context.formCanceled

  • Actions - skip this section

  • Context - skip this section

  • Output - in output you can enter the next text: "The form is canceled. How can I help you else?"

Step 13. Save the changes by pressing button "Save Changes". Now you have created the simple skill with one dialog node.

Remember to save your changes.

You should have next dialog tree:

Step 14. Test the results. Go to the Hala Web Chat by using the next link https://chat.hala.ai/ and type the first message in the chat. You can type one of the trained phrases, or you can use new phrases that weren't specified in intent training.

And then if you will click "Save," you will see the following results:

If you will click "Cancel," you will see the following results:

Congratulations! You have created your skill and tested it.

If you want to know more about the functionality of the Forms, please go here.

Later, you can build more nodes and for example, send the information from the form to your external application, for instance, in JIRA Service Desk.