GoLess
  • Basics
    • Recording Actions
    • Adding workflow manually
    • Tutorial: Scraping data
  • Workflow
    • Customization
    • Blocks
    • Global Data
    • Variables
    • Element Selector
    • Expressions
    • Workflow Table
    • Looping
    • Google Drive
  • Blocks
    • General
      • Note Block
      • Trigger Block
      • Execute Workflow Block
      • Delay Block
      • Export Data Block
      • HTTP Request Block
      • Blocks Group
      • Clipboard Block
      • Wait Connections Block
      • Notification Block
      • Workflow State
      • Parameter Prompt Block
    • Browser
      • Active Tab Block
      • New Tab Block
      • Switch Tab Block
      • New Window Block
      • Proxy Block
      • Go Back Block
      • Go Forward Block
      • Close Tab/Window Block
      • Take Screenshot Block
      • Browser Event Block
      • Handle Download Block
      • Handle Dialog Block
      • Reload Tab Block
      • Get Tab URL Block
      • Cookie Block
    • Web Interaction
      • Click Element Block
      • Get Text Block
      • Scroll Element Block
      • Link Block
      • Attribute Value Block
      • Forms Block
      • Javascript Code Block
      • Trigger Event Block
      • Switch Frame Block
      • Upload File Block
      • Hover Element Block
      • Save Assets Block
      • Press Key Block
      • Create Element Block
    • Control Flow
      • Repeat Task Block
      • Conditions Block
      • Element Exists Block
      • While Loop Block
      • Loop Data Block
      • Loop Elements Block
      • Loop Breakpoint
    • Data
      • Insert Data Block
      • Delete Data Block
      • Get Log Data Block
      • Slice Variable Block
      • Increase Variable Block
      • RegEx Variable Block
      • Data Mapping Block
      • Sort Data Block
    • Оnline Services
      • Google Sheets Block
    • Premium
      • ChatGPT Block
      • Captcha Block
  • REFERENCE
    • Logs
    • Schedule
    • Storage
    • Packages
    • Condition Builder
    • Workflow Common Errors
    • JavaScript Execution Context
Powered by GitBook
On this page
  • Variable Name
  • Variable in JavaScript Block
  • Variable Prefix
  • $$
  • $push:
  • Functions you can use
  1. Workflow

Variables

PreviousGlobal DataNextElement Selector

Last updated 1 year ago

As we know, variables are used to keep a value and are accessible throughout the workflow.

For instance, an extracted text by the Get Text block can be stored inside a variable. Later you can access that variable in another block.

Variable Name

You are free to choose any name for the variable. But for ease of access to the variable inside a mustache tag, do not include space, at (@), and bracket ([]) in the variable name.

Variable in JavaScript Block

We can use variables created in Java Script in other blocks. To do this, create a golessSetVariable in a Java Script block before that, you can write code that will calculate the values for this variable.

After that you can pass this variable to other blocks that come after your block that creates this variable.

Variable Prefix

GoLess utilizes symbols or prefixes in the variables' names. Also, it may use commands to demonstrate a specific purpose or functionality. For instance, $$ indicates that the variable is kept on storage (e.g., $$variableName).

$$

As we said above, the $$ prefix indicates that the variable value is kept in the storage.

  • See also: Storage

$push:

By using $push: as a prefix, you tell GoLess to change the type of variable data to an array. If the variable already has a value, the value will change to the first element in the array. If you assign a value to the variable, GoLess will push this value into the variable instead of overwriting the value of the variable.

Suppose you make a loop through the elements and want to get the text of the element by using the Get Text block and setting the text of the element to a variable with $push: as a prefix $push:texts. On the first iteration, the value of the texts variable is ["Text 1"], on the second iteration["Text 2"], etc.

Functions you can use

  • $date - get the current date.

  • $randint - generating a random integer.

  • $getLength - get the length of some data structure (string, list, etc.).

  • $slice - extracting a subset or slice from a data structure.

  • $multiply - perform multiplication operation.

  • $increment - incrementing a value by one.

  • $divide - performing a division operation.

  • $subtract - performing subtraction operation.

  • $randData - generation of random data.

  • $filter - filtering data based on certain conditions.

  • $replace - replacing a certain value with another one.

  • $replaceAll - replacing all occurrences of a certain value with another.

  • $toLowerCase - converts all characters in a string to lower case.

  • $toUpperCase - converting all characters of a string to upper case.

  • $modulo - performs the operation of taking the remainder from division.

  • $stringify - converting some value into a string.

Create JavaScript code block and Delay Block like simple
Use: golessSetVariable
Set variable in Delay Block