Add a form to bot
- Updated: 2023/02/24
Add a form to bot
Adding an existing form to a bot enables users to collaborate with bots. Use the necessary action items to create a bot and build a task logic.
This task describes a scenario where you want to design a bot that
triggers an existing New User Registration form. A Hot key
preset trigger starts the bot. An existing form that is linked to the
bot is displayed where the user enters the information.
- If the user clicks Submit, a User Agreement form is displayed.
- If the user clicks Cancel, User registration is canceled message is displayed and the bot is terminated.
Procedure
-
On the left pane, click Automation.
A list of available bots and forms is displayed.
- Click Create new > Bot.
-
Enter a name for the bot.
All the bots are stored in the \Bots folder. Click Browse to change the folder.
-
Click Create & edit.
The bot builder pane is displayed that has Flow (default view), List and Dual view. You can drag the required actions from the left pane to create a task.
- In Triggers > Hot key, drag Hot key trigger into Drag a trigger here in the bot logic.
- Set Ctrl and L as the hot key combination.
- Use the Search actions field to find Interactive forms.
-
Drag Display into the task logic.
You can use the display action to show the form when the bot is triggered. The display action properties appear on the right.
-
Click the create variable icon () to create a variable.
You have to create a form variable by linking an existing form. This enables you to use the form variable and the associated form across multiple instances.Note: The form variable can be linked only to forms created using the Control Room form builder.
- On the Create variable screen, enter a name for the form variable you are creating.
-
Click Browse and select the New User Registration
form.
This links the New User Registration form to the form variable that you are creating.
-
Click Create & select.
A new form variable is created. For any existing form variable, use the Form name drop-down menu to select it.
-
Use the Search actions field to find Trigger
loop and drag it to add event monitoring.
Event monitoring enables you to simultaneously set multiple events within the task logic of a bot.
-
Drag Handle into the Trigger
loop.
Handle enables you to run an action by configuring a trigger in the Trigger loop: Handle for the bot. You can set a trigger when a event occurs on the selected interface (selected application) or when a user clicks the selected form element.
- For this scenario, use the Trigger on drop-down menu to select INTERACTIVE FORMS > Form trigger.
-
Click the Form name drop-down menu and select the New
User Registration form.
This enables you to set a trigger for the Submit option of the New User Registration form.
-
Click the Form element drop-down menu and select
Submit.
For the Button element of a form, the Select action trigger is set to Clicked by default. When the user clicks Submit on the New User Registration form, it triggers the User Agreement form.
-
(Optional) Use Assigned to to create a variable.
You can use this variable to fetch various details for the element you have selected in the Form element drop-down menu. This return value is either a string or number based on the element type selected. For example, if you have selected the Date element, the return value is a string.
- Search for Interactive forms and drag Display into Trigger loop: Handle.
-
Click the Form name drop-down menu and select User
Agreement form.
The User Agreement form appears.
-
Search for Message and drag it into Trigger
loop: Handle, after Interactive
forms.
A successful registration message appears when the user clicks Submit.
-
Terminate the trigger by dragging Break into the
Trigger loop.
Use Break to exit the current event loop and for actions where finishing a process is required.
-
Drag another Handle next to the Trigger loop:
Handle.
This enables you to set a trigger for the Cancel option of the New User Registration form.
- Click the Form element drop-down menu and select Cancel.
-
Search for Message and drag it into Trigger
loop: Handle. Update the Enter the message to
display field as User registration is canceled.
When the user clicks Cancel on the New User Registration form, it triggers a User registration is canceled message and terminates the bot.
- Drag Trigger Loop > Break to terminate the loop.
- Click Save.
-
Click Run with triggers.
The Run with triggers sets the Hot key trigger to start the bot, which is Ctrl plus L combination from the keyboard in this scenario.