« Prev Section | User Interaction |
By now, you should have learned some application building basics along with some basics of user interaction within your application. We'll now move on with learning how to use the branching and logic modules for our application.
In our last section, we learned how to build an autoattendant using the Simple Menu module, the Multipart + Yes/No module, and Transfer modules as the backbone for that application.
However, instead of using a Simple Menu module with multiple Multipart + Yes/No modules, we can use a Multiple Choice module with just one Multipart + Yes/No module using one of the branching modules.
From the starting page, let's add a Multiple Choice module onto the workspace and connect the circular node from the Start module to the triangular node on the Multiple Choice module.
Once you've connected the modules together, enter the following text in the textbox of the Multiple Choice module: “Hello! Welcome to The General Store. For sales, press 1 or say sales. For support, press 2 or say support. To speak to an operator, press 0 or say operator.” Then, click on the + button twice to add two additional options for your module. For your first option, enter “sales” in the textbox under Or say. For your second option, select 2 from the drop-down menu and enter “support” in the textbox under Or say. For the third option, select 0 from the drop-down menu and enter “operator” in the textbox under Or say.
Also, just like with our last Autoattendant example, let's set our Multiple Choice module to “Set result to keyword” to set the variable, multChoice, to either sales, support, or operator based on the user's input.
Next, let's drag out one Multipart + Yes/No module to the workspace and connect the circular node of our Multiple Choice module to the triangular node of the Multipart + Yes/No module. For the Multipart + Yes/No module, enter the following text in the textbox: “You answered”. Click on the + button to add two additional phrases/variables to your module.
Next, click on the toggler for your second phrase/variable to convert it to a variable and select multChoice as your variable.
For your third phrase/variable, enter the following text in the textbox: “Is this correct? Press 1 for yes or 2 for no.”
Next, connect the circular node from the “No” node of the Multipart + Yes/No module to the triangular node of the Multiple Choice module.
For the “Yes” node of the Multipart + Yes/No module, we're going to connect a Branching module to it. To do this, first click on Variables and Math to display the list of modules to choose from.
From this list of modules, select the Branch on String module and drag it out to the workspace. Then, connect the “Yes” node of the Multipart + Yes/No module to the triangular node of the Branch on String module.
Next, select multChoice as the variable for your Branch on String module.
Then, click on the + button to add another value to compare with your multChoice variable. For the first Value, enter “sales” in the textbox. For the second Value, enter “support” in the textbox.
From here, drag out 3 Jump to Page modules to your workspace. For the Branch on String module, connect the circular node from “sales” to the triangular node of one of the Jump to Page modules. Then, connect the circular node from “support” to the triangular node of another of the Jump to Page modules. Last, connect the circular node from “Default” to the last Jump to Page module.
From here, you can follow the same instructions mentioned in the User Interaction section for creating the Sales page, Support page, and Operator page if you wish to continue rebuilding the autoattendant application.
From this new autoattendant example, we were able to reduce the number of modules used for our previous autoattendant example by using a Multiple Choice module and a Branch on String module. Unlike the Simple Menu module, the Multiple Choice module only has one node to branch off of instead of the 3 nodes we could branch off of in the Simple Menu module. This cuts the number of Multipart + Yes/No modules that we used from our previous autoattendant example down to 1 instead of 3. Also, the Branch on String module allows us to branch off to various pages in our autoattendant application by using an “if” condition for our multChoice variable. If the user chose sales, the Branch on String module would branch to the Sales page of the application. If the user chose support, the Branch on String module would branch to the Support page of the application. If the user chose an input other than sales or support, then the Branch on String module should default to the Operator page of the application.
In addition to the Branch on String module, there is a Branch on Number module that is available for number entries by the user. The Branch on Number module is particularly useful for verifying information entered by the user with information that is stored in a data table and then acting upon it. We'll cover that example in the next section.
For now, let's come up with a short example that demonstrates how to use the Branch on String module.
First, drag out a Simple Prompt module onto your workspace and connect the circular node from the Start module to the triangular node of the Simple Prompt module.
In the textbox of the Simple Prompt module, enter the following text: “Hello! Welcome to check-in system for The Company.”
Next, drag out a Digits Input module onto your workspace. Connect the circular node of the Simple Prompt module to the triangular node of the Digits input module. In the textbox of the Digits Input module, enter the following text: “Please enter the employee verification number.”
Drag out a Multipart + Yes/No module onto your workspace. Connect the circular node of the Digits Input module to the triangular node of the Multipart + Yes/No module. For the Multipart + Yes/No module, enter the following text in the textbox: “You entered”. Then, click on the + button to add two additional phrases/variables to your module.
Next, click on the toggler for your second phrase/variable to convert it to a variable and select digits as your variable.
For your third phrase/variable, enter the following text in the textbox: “Is this correct? Press 1 for yes or 2 for no.”
From here, connect the circular node from the “No” node of the Multipart + Yes/No module to the triangular node of the Digits Input module.
For the “Yes” node of the Multipart + Yes/No module, we're going to connect a Branch on Number module to it. Click on Variables and Math and drag out the Branch on Number module to your workspace. Then, connect the circular node for “Yes” on the Multipart + Yes/No module to the triangular node on the Branch on Number module.
Next, select digits as the variable for your Branch on Number module.
In the value textbox, enter the following digits: 1234007. Next, drag out a Simple Prompt module onto your workspace and connect the circular node for “Default” from your Branch on Number module to the triangular node of your Simple Prompt module. In the textbox of the Simple Prompt module, enter the following text: “I'm sorry, the employee verification number you entered is not authorized. Goodbye.”
Finally, drag out an Exit App module to your workspace and connect the circular node from your Simple Prompt module to your Exit App module.
For the “1234007” branch of your Branch on Number module, drag out a Simple Prompt module and connect the circular node of the “1234007” branch of the Branch on Number module to the triangular node of the Simple Prompt module. In the textbox of the Simple Prompt module, enter the following text: “Thanks for entering the correct employee verification number.” From there, you can drag out an Exit App module to your workspace and connect the circular node of the Branch on Number module to the triangular node of the Simple Prompt module that states: “Thanks for entering the correct employee verification number.”
Once you have entered the text, your application should look like the following.
From this application, a user is prompted to enter an employee verification number. Once the user has entered a number, they are prompted to confirm if the number they have entered is correct. If the user answers no, they are prompted to enter an employee verification number again. If they answer yes, the input is then sent to the Branch on Number module to be compared to an 7-digit number. If the number is incorrect, the Branch on Number module branches to the default behavior that prompts the user with the following message: “I'm sorry, the employee verification number you entered is not authorized.” If the number is correct, the Branch on Number module branches to the “1234007” node that prompts the user with the following message: “Thanks for entering the correct employee verification number.”
Next Section » | Variables and Math |