Skip to content
PD
Browser Automation Studio

Working with Lists in BAS

The List module in Browser Automation Studio — store, iterate, sort and transform collections of data in memory, and how lists differ from resources.

Whenever a bot handles “a bunch of things” — a set of links, parsed rows, a batch of values — it holds them in a list. The List module is the standard in-memory collection in BAS, with all the operations you’d expect from arrays in any language.

What a list is

A list is an ordered set of elements in one container. It lets you work with a collection of data, iterate over it, save it to a file and reload it, and repeatedly pass over its elements. Within a single thread, it’s where your working data lives.

The operations

Building and reading.

  • Create list — start a new collection.
  • Add element / Insert element — append, or place at a specific position.
  • Get element / First element / Last element / Random element — read by position or pick one at random.
  • Set element — overwrite the item at an index.

Removing.

  • Delete by index / Delete by value — drop an item by position or by matching content.
  • Clear list — empty it.

Querying.

  • Count elements — how many items it holds.
  • Search element / Get index — find an item and its position.

Transforming.

  • Sort — order the elements.
  • Reverse list — flip the order.
  • Copy list — duplicate it.
  • Combine lists — merge two lists into one.
  • Compare lists — check whether two lists match.
  • Join to string — flatten the list into a single string, e.g. comma-separated.

Lists vs resources

A list is the right tool for data inside one thread. The moment many threads need to pull from the same shared pool — a list of accounts split across 100 workers — switch to the Resources module, which handles distribution and the concurrency conflicts a plain list can’t. Rule of thumb: lists for local working data, resources for shared run input.

FAQ

What is a list in BAS?

A list is an ordered collection of elements held in one container. You add, read, sort, search and transform its items, and you can save it to a file or load one from a file. It is the standard way to hold a set of data while a bot works.

When should I use a list versus a resource in BAS?

Use a list for data within a single thread. Use a resource when many threads must pull from the same pool safely, because the Resources system handles distribution and concurrency that a plain list does not.

More on this topic

  • #Browser Automation Studio
  • #BAS
  • #Lists
  • #Data
  • #Collections

Have an idea? Let’s turn it into a working product.

Skip months of uncertainty. Get a clear architecture, a working MVP and a system you can test, sell and scale.