Before we create an RPA automation process by ourselves, let's get familiar with some terms.
Data is stored in an object in the form of {key: value}. As shown in the diagram below, we can use an object to represent a person's information. In this object {...}, "Name," "Age," and "Gender" are keys, while "Jack," "25 years old," and "Male" are values.

As shown below, there are 2 objects, each representing information about a different person.

An array is an ordered collection. Let's start with a simple array. As shown in the image, the array contains 4 elements. The array index starts from 0, a[0] represents the first element of the array, a[1] represents the second element of the array, a[2] represents the third element of the array, and so on.

The elements in an array can also be objects. As shown in the image, there is an array containing 3 objects.

As shown in the image, the values of a[0], a[1], and a[2] are:

Now, you should have a clear understanding of the concepts of arrays and objects. If you are still not familiar, it is recommended to Google the relevant knowledge for further learning. Search keywords such as: JavaScript arrays, objects.
What are CSS selectors? CSS selectors are used to "find" (or select) the elements you want to style with CSS.
Let's see an example!
Suppose there are 10 posts on a page, and only the 5th post is the one you want to like using RPA. To achieve this, you need to use a selector to locate the "Like" button on the 5th post and then click on it. Without a selector, RPA has no way of knowing which element to find.
As shown below, enter the selector #nav-search-submit-button , then RPA will click on elements containing <xxxx id=nav-search-submit-button> within the page.

The following code is an example to explain how to use the three selectors: learning document
<div class="one_class">one</div>
<p class="two_class">two</p>
<span id="three_class">three</span>| Selector Type | Description |
|---|---|
| Selector | Refers to a CSS selector, a method for selecting HTML elements using CSS syntax. For example, using the CSS selector .one-class can select all elements with the class name one-class, allowing you to retrieve elements like one in the above code. |
| XPath | XPath is a language used to find nodes in XML and HTML documents. It uses path expressions to select elements, which can be very specific, including the element's attributes, text content, position, etc. For example, //p[@class='two-class'] will select all p elements with the class name two-class. |
| Text | Directly fill in the text of the element you want to select. For example, if you enter "three", you can directly retrieve that element. |
Variables (officially known as custom properties) are placeholders that store reusable values in CSS. For example, you retrieve a text string from a webpage: “I love AdsPower!", and store it in variable A. If you need to use this text, you can call it via variable A.
Within RPA, variables are categorized into three types: system variables, global variables, and variables set within processes. System variables are designated separately as “system variables,” while global variables and those set within processes are collectively referred to as “process variables.”

System variables: Usually refer to information about the profile or task, such as the task IS, profile notes, and other related content.
Global variables: Variables you set at the beginning of the process, which will be used in the whole process and can be edited on the Process page.

Variables set within process: Actions such as [Get Data-URL], [Get Data-Element] and [Data Processing-For Loop Elements] can help store elements that can be reused later in variables.

There are many cases where you want certain code to run only when a specific condition is met, and a different set of code to run when the condition is not satisfied.
For example, we enter the password in the input box on the account login page, or refresh the page if there is no input box. That's where [Statement if] comes in handy.
[Statement if] evaluates a variable or compares it against input results: variable exists/does not exist, contains/does not contain, equals/does not equal...When the condition is met, execute Step 1; otherwise, execute Step 2, or take no action and proceed to the next step.

A loop is essentially repeating a specific task. For instance, liking multiple posts, collecting all comments under a product and saving them to a document, pagination operations, clicking through multiple images, and so on. When you encounter such scenarios, you should consider using a for loop to handle these repetitive, mechanical tasks.
There are three For Loops and one While loop in RPA operations, they are For Loop Elements, For Loop Times, For Loop Data, and While Loop, which will be covered in detail later. This section provides only a brief introduction.

