Browserflow
  • 👋🏽 Welcome to Browserflow
  • Guides
    • Building a flow
    • Running a flow
    • Debugging a flow
    • Sharing a flow
    • Automating Google websites
    • Keyboard shortcuts
    • Selectors
    • Variables
    • Input variables
    • Conditions
  • Browserflow Cloud
    • Running flows in the cloud
    • Loop Sheet flows
    • Saving files
    • Automating sites behind a login
    • API
    • Webhooks
    • Zapier
    • Troubleshooting
  • Reference
    • Browserflow commands
      • Interact with Page
        • Click
        • Type Text
        • Press Key
        • Scroll
        • Hover
        • Select Option
        • Set Date Input
        • Upload File
        • Handle Dialog
      • Extract Data
        • Get Element Text
        • Get Link URL
        • Get Page URL
        • Get Element Attribute
        • Get Element HTML
        • Get Clipboard
        • Save File
        • Take Screenshot
        • Generate PDF
      • Navigate
        • Visit
        • Go Back
        • Go Forward
        • Reload Page
      • Spreadsheet
        • Loop Spreadsheet Rows
        • Add Spreadsheet Row
        • Update Spreadsheet Row
        • Find Spreadsheet Row
      • Control Flow
        • Loop Elements
        • Loop Pages
        • Loop
        • Loop List Items
        • If
        • Else
        • While
        • End
        • Break
      • Tabs
        • Create Tab
        • Get Active Tab ID
        • Select Tab
        • Close Tab
      • Utilities
        • Run Script
        • Get Date
        • Wait
        • Wait for Element
        • Show Alert
        • Make HTTP Request
        • Assert
        • Run Flow
        • Comment
        • Solve Captcha
  • Support
    • Getting help
    • Common errors
  • Troubleshooting
    • Updating to the latest version
Powered by GitBook
On this page

Was this helpful?

Last updated 2 years ago

Was this helpful?

Variables allow you to store information that can be used throughout a flow.

For example, variables can be used to store information from the the page (e.g. ) and pass it into other commands.

Naming

All Browserflow variables start with the prefix $, as in $selector. This naming convention allows Browserflow to differentiate between variables and normal text.

For example, running with the message Hi $name will cause Browserflow to replace $name with the value for the variable and leave the "Hi" portion intact.

Caveats

Due to this naming convention, extra processing is required if you want to append text directly to a variable.

For example, suppose you have a variable named $time that holds a value like 9:30. If you wanted to show an alert with the message The time is 9:30AM, you may try setting the message field to The time is $timeAM. However, this wouldn't work because Browserflow would look for a variable named $timeAM rather than append "AM" to a variable named $time.

In order to get the formatted text, create a new variable using . In this case, you can run it with the code const $formattedTime = $time + "AM"; and set the alert message to The time is $formattedTime.

  1. Guides

Variables

PreviousSelectorsNextInput variables
Get Element Text
Type Text
Run Script