ZeroWork
  • 👋Home and Welcome
  • 🚀Getting Started
  • ⬇️Install the Agent
  • 🧑‍💻Crash Course
  • Using ZeroWork
    • 🖥️General: Run, Schedule, Share, Webhooks
      • Run
      • Stop
      • Log in to the Agent
      • Run Modes
        • Run Incognito
        • Run Non-Incognito
        • Run in My Regular Browser
      • Run Settings
        • Run in Background
        • Stay on Page after Run
        • Bring Pages to Front
      • TaskBot Sharing Options
      • Cookies
      • Scheduler
      • Trigger Run via Webhook
      • Proxies
      • Remote (Cloud) Execution
      • How to Check and Update Your Agent
      • Install ZeroWork Agent on VPS
    • 📔Using Selectors
      • What Are Selectors
      • Use Element's Text
      • Copy Selectors
      • How to Build Custom Selectors
        • Basic Concepts of Selectors
        • One Element Can Have Many Selector Expressions
        • Check if Selector Is Correct and Unique
        • Exact or Loose Match
        • Hierarchy
        • Combine Filters with Standard CSS Logic
        • Lists: Incremental CSS Selectors
        • Addressing Siblings
      • How to Use XPath in ZeroWork (advanced)
    • 🏗️Using Building Blocks
      • Open Link
      • Save Page Url
      • Switch or Close Tab
      • Go Back or Forward
      • Switch Frame
      • Browser Alert
      • Click Web Element
      • Check Web Element
      • Save Web Element
        • Save Lists
        • Enrich Existing Data
        • Stop Run If Selector Is Not Found Option
      • Insert Text or Data
      • Hover Web Element
      • Select Web Dropdown
      • Keyboard Action
      • Start Condition and Set Condition
        • Actions = & ≠
        • Actions <, ≤, >, ≥
        • Data Found & Data not Found
        • Contains & Does Not Contain
        • Before (Date) & After (Date)
      • Start Repeat
        • Standard Loop
        • Dynamic Loop
        • Continue until No Element Is Found
        • Auto-Scroll
        • Auto-Continue from Last Row or Element
        • Nested Loops - Handle Pagination
      • After Repeat
      • Break Repeat
      • Try-Catch
      • Raise Error
      • Abort Run
      • Update Data
      • Number Operations
        • Example: Standardize different formats
      • Format Data
        • Remove Words
        • Shorten Content Length
      • Split Data
      • Apply Regex
      • Remove Duplicates
      • Delete Data
      • Ask ChatGPT
      • Send Notification
      • APIs: Send HTTP Request
      • Write JavaScript
      • Save File
      • Upload File
      • Delay
      • Record Date
      • Take Screenshot
      • Save from Clipboard
      • Log
      • Building Block Options
        • Delay Times between the Building Blocks
        • Randomize Delay Time
        • Deactivate Building Blocks
        • Shortcuts
        • Spintax
        • Auto-Align
        • Sticky Notes
    • 🔀Using Variables
    • 💿Using Tables
      • How to Add Tables
      • Native Tables
      • Google Sheets
      • Import Data from CSV
      • Using Google Sheet vs. Native Tables
      • Create Columns
      • Export Data as CSV
      • Convert Native Table to a Google Sheet
    • 📄Using Run Reports
    • 😑Common Problems
      • My TaskBot Does Not Start Run
      • When I Use Data from Table, No Data is Being Pulled
      • Website is Glitching and Flashing
      • No Selector is Found
      • My TaskBot Saves Some Data but Not All
      • Data Is Saved in Wrong Format
      • Website Requires SMS or Email Verification
      • Keyboard Action Is Not Working As Expected
      • Check Web Element Identifies Selector as Found but Next Action Does Not
      • When Using Insert Data Block, First Letters Are Cut Off
      • Workflow Has More than One Starting Building Block
      • TaskBot Does Not Automatically Scroll
  • Support
    • 🆘Getting Support
  • 🆕Release Notes
    • Version 1.1.61
    • Version 1.1.62
    • Version 1.1.63
    • Version 1.1.64
    • Version 1.1.65
    • Version 1.1.66
    • Version 1.1.67
    • Version 1.1.68
Powered by GitBook
On this page
  • When to Use Tables and When to Use Variables
  • Video Tutorial

Was this helpful?

  1. Using ZeroWork

Using Variables

PreviousSticky NotesNextUsing Tables

Last updated 4 months ago

Was this helpful?

Variables are for saving or updating data that you temporarily need during your TaskBot run.

Since Variables don't adhere to any appending or looping logic, it's a powerful, robust and flexible way to save or update any data that you temporarily need in order to advance in your workflow without having to worry about loop set-up.

When to Use Tables and When to Use Variables

Example: Use variable to limit number of DMs sent per run

To understand the differences between tables and variables, let's go over an example.

Imagine you want to send an automated DM to a list of profiles. However, you want to limit the number of profiles that you reach out to per day or per run. Let's say, you want your TaskBot to never send more than 30 DMs per run.

Step 1: Initial table set-up

Let's assume your list of profiles is stored in the table called "Profile links", as shown below. (See How to Add Tables).

Step 2: Initial TaskBot set-up

To start sending DMs, you would build a TaskBot that first opens the website where DMs can be sent, then loops through the rows in your table, inserts text into DM input and clicks on "Send" button.

The TaskBot set-up would look like this:

Here is the set-up of the Start Repeat building block (see Start Repeat).

Step 3: Creating a variable

Now, let's add the limit.

To ensure that TaskBot doesn't send more than 30 DMs, we need a counter which should increment by 1 each time TaskBot sends a DM. This is a great example where you need a variable. A table would not be an appropriate choice for this use case because we don't need 30 rows with a counter number (as in 1, 2, 3, 4, 5, etc.), instead we need a single value that dynamically increments during the TaskBot run.

First, we need to create a variable, as shown below.

Let's call the new variable "DM counter". You can leave the variable value empty or you can enter "0" (as the count should start with 0).

Step 4: Updating the counter during TaskBot run

Let's now add the logic to update the variable during the TaskBot run. To update "DM counter", use the building block Number Operations.

This is the set-up of the Number Operations building block that adds 1 in every loop iteration (and every loop iteration sends a DM):

Step 5: Setting up a condition to check the counter

The last piece that is missing is a condition that checks if the counter is less than 30. This is how to add that:

Conditions are set using Start Condition and Set Condition building blocks (see Start Condition and Set Condition). Here is the set-up of the Set Condition:

Video Tutorial

🔀