List package
- Updated: 2023/09/14
List package
The List package contains actions that enable you to perform various operations on a variable of the list data type.
Working with variables of list data type
A list is a collection of ordered values. The values can be of Boolean, number, or string data subtype. When initializing a list variable, you can select the Any data subtype in order to hold any of the three data subtypes. You can manually enter values by creating a new variable or selecting an existing one from the Variables menu, and then clicking Add.
- Sending an email to multiple recipients.
- Searching multiple web addresses.
- Sorting of list values is currently not supported.
- You cannot directly assign values from the record to a list. However, you can use Loop action to loop through all the record items and then add them to the list variable.
Actions in the List package
If you are using a List action in a Loop action, you must use the For each item in the list iterator.
The following actions are available in the List package:
Action | Description |
---|---|
Add item | See Add item action in List. |
Append | See Append action in List. |
Assign | See Assign action in List. |
Clear | See Clear action in List. |
Get item | See Get item action in List. |
Join items | See Join items action in List. |
Remove item | See Remove item action in List. |
Set item | See Set item action in List. |
Size | See Size action in List. |
Example
- Create a bot.
- On the left panel, click Automation.
A list of available bots and forms is displayed.
- Click Create a bot.
- Enter the bot name: ListBot
- Click Create and Edit.
- On the left panel, click Automation.
- Create the following variables.
- Variable: StringList
- Type: List
- Subtype: String
- Name: StringList
- Default value at 0: Automation
- Default value at 1: Anywhere
- Variable: SampleString
- Name: SampleString
- Default value: PvtLtd
- Variable: ListOutput
- Type: Any
- Name : ListOutput
- Variable: StringList
- To insert an item into a list variable, from the Actions pane, double-click
or drag the action.
- In the List variable field, select StringList.
- In the Items to be added field, select SampleString.
- To insert the item at the end of the list, select the To end of list option.
- To retrieve a value at a specified position in a list, from the Actions
pane, double-click or drag the action.
- In the List variable field, select StringList.
- In the Index number field, enter 0. This is to specify the position in the list from where you want to retrieve a value.
- To store the output from Assign the output to variable list, select ListOutput.
- To print the value of the Index 0, double-click or
drag the Message box
action. Click Save and
Run.
The bot displays the zero index data of the list variable, which is Automation.