Have you ever written computer scripts? After reading this article, you will be able to create your own simple scripts on the TruCHAT platform. Let's now write a script that will collect your visitor's name and email address and create a ticket upon their request.

1. Go to the Chatbots section and click Add Chatbot.

null

2. Select Blank Template Chatbot and click Create.

null

3. It will appear in your chatbot list. Now click its name.

null

4. You will see Trigger and Script templates to start with. Double-click Script #1.

null

5. Click Add Step and select Content.

null

6. Click Text to enter your chatbot's phrase.

null

7. Say Hi to the visitor and ask their name.

null

8. Click User Input to receive a response from the visitor.

null

9. In the Edit User Input pop-up, select Free Text Only as user input type.

null

10. Save user input to the First Name field.

null

11. Repeat steps 6 - 9 for asking the visitor's email.

null

12. Repeat steps 6 - 9 for collecting the visitor's request, but don't save it to any field. Click Go To.

null

13. Now let's put our Step #1 aside for a moment and create another one. Click Add Step and select Perform Actions.

null

14. Click Create Ticket.

null

15. Now it's time to connect our steps. Click the lowest linking point in Step #1 and drag it till it reaches the Perform Actions step. This will mean that the chatbot will create a ticket (see step 14) right after the visitor enters their question (see step 12).

null

16. Click the linking point in Perform Actions and drop it on the canvas. You will be offered to create another step (you can use this method instead of clicking the Add Step button). Select Content.

 

null

17. Inform the visitor that the ticket has been created.

null

18. Click Delay to give the visitor time to read your message before the chat session is over.

null

19. Click Add Step and select Terminate Chat.

null

20. Return to Step #2 and click Go To.

null

21. In the Edit Go To pop-up, select Terminate Chat from the Go To / Action dropdown list. This is another way of connecting your steps instead of dragging the links on the diagram.

null

22. Now we have to return to the screen from step 4 and set up the trigger. Click Diagram tab

null

23. Click Trigger.

null

24. Select the desired connection from the dropdown list.

null

25. Connect the trigger to your script. Other fields can be left with default values for now.

null

26. And that's it! You can now preview your chatbot. Click Preview in the upper toolbar.

null

27. In the Chatbot Preview Options pop-up, click Launch Preview.

null

28. See your chatbot working!

null

29. You will find the created ticket in the Activities section.

null

Congratulations! Now you can create your own simple scripts and even experiment with different script steps. We will dive deeper in the next article, stay tuned!