Tutorial

3-1. Record tasks to be performed when conditions match

Sample pages for this tutorial

This section explains how to record tasks to be performed when conditions match.

* For basic operations of CloudBOT, please refer to "Basics - Chapter 1-1. Acquiring data from web pages (including an explanation of basic operations)".


Create a BOT

1. Open the BOT editor

Open the BOT editor from the "Create BOT" button.


2. Open the Data viewer

Click on "Viewer" in the lower left corner of the screen.


The Data viewer will open.


3. Add data

Add the following to the data.
Data type: "text" Data name:Name Data:John Smith
Data type: "Text" Data name:Age Data:20


Click the "OK" button to confirm the data.


4. Access the sample page

Display the sample page https://www.c-bot.pro/sample-en/basic/basic-3-01.html and start recording operations.


5. Set task execution conditions

Click the "Add  a condition" button.


A window for specifying Condition will appear.


Specify "Age" for the left value.
"Any value" as the right value, and enter 12 in the input form below.


Specify "is greater than or equal to" as the comparison condition.


Click the "OK" button.


A condition is added to the task.


6. Record tasks that match the conditions

Move the task cursor inside a Condition.
Click on the upper portion (between the tasks) that displays "Tasks can be added here."


When a confirmation alert appears, click the "OK" button to move the task cursor.


This moves the task cursor inside a Condition.
The content of this recording is executed only if it matches the set conditions.


If you want to move a task cursor within a Condition, the current state of the BOT editor must match the condition you have set.
In this case, the "Age" value is set to "20", the condition set
"Age: 12 years or older".
Since these are Condition matches, the task cursor can be moved inside a Condition to record the operation.

Record the operation of clicking the "Adult" button.


As the screen transitions, please record the displayed amount as the fee. The copied fee, is then recorded as part of the task.


This completes the task recording of the BOT to be executed when the condition is matched.


7. Return task to initial position and execute again

Click "Stop" in the top left corner of the task menu to halt the virtual browser. This action returns the task cursor to the beginning.


Click "Start" in the top left corner of the task menu to advance the task to the end.


Currently, the "Age" data value is set to "20" in the previous step.
"Age: 12 years or older"
The condition matches the condition from the previous step, so all recorded task executions, including the conditional task, can be confirmed.


8. Change the value and execute again

Click "Stop" in the top left corner of the task menu to halt the virtual browser. This action returns the task cursor to the beginning.


Open the Data viewer and change the "Age" to 10.


Click the "OK" button to confirm the data.


Click "Start" in the top left corner of the task menu to advance the task to the end.


Currently, the data value for "Age" is set to "10" in the previous step. The conditions are
"Age: 12 years or older"
Due to the condition mismatch, the task within a Condition is not executed and the task is executed to the end.


9. Save the BOT

Change "BOT Name" to 3-1. Record tasks to be performed when conditions match.


Change the "Name" and "Age" set in the "BOT internal data" to the input data and save them.


Since you changed the "Age" value in the previous step, you will get a warning message "There is a difference between the BOT internal data and the data being edited.". Click the "OK" button to save the data.


Execute BOT

1. Execute the created BOT


Select the created BOT and open the execution screen.
Click the "Start" button without changing the initial values of "Name" and "Age," which are set as input data as John Smith and 20, respectively.

When the bot execution is complete, the results of the execution are displayed.
Check that "The execution was successful.", the acquired data "Adult $8" are displayed in the from of the fee.


Close the execution result screen.
Select the created BOT again and open the execution screen.
This time, change the initial values of "Name" and "Age" set as input data, Jane Doe and 10, respectively, and click the "Execute" button.


The BOT execution completes and the results of the execution are displayed.
"The execution was successful." and if the fee is blank, it is complete.


This concludes the tutorial "3-1. Record tasks to be performed when conditions match".

Go to the next tutorial >> 3-2. Record tasks to be performed when conditions not match