Logo Text Blaze
  • Products
    • Text Blaze
      Snippets and templates
    • AI Blaze
      AI writing and editing
    • Data Blaze
      Tables and sheets
    Downloads
    • Add to Chrome
    • Windows app
    • MacOS app
  • By function
    • Support & operations
    • Sales
    • Healthcare
    • Education
    • Recruiting
    • Marketing
    Business
    • For teams
  • Resources
    • Documentation
    • Community forum
    • Gallery
    • Contact us
  • Pricing
Documentation
No search results
Text Blaze
Loading...
Data Blaze
Loading...
Community Forums
Loading...
Add to Chrome –  It's Free! Go to Dashboard ›
Docs > Guides
  • Guides
    • Quick Start
    • Sharing Snippet Folders
    • Best Practices for Shortcuts
    • Creating Snippets With AI
    • Dynamic Commands
    • Date and Time
    • Forms
    • Formulas
    • Rules & Validation
    • Tables in Snippets
    • Connect Other Apps
    • Tidying Whitespace
    • Lists
    • Autopilot
    • Read Data from Websites
    • Workflow Automation
    • Buttons and Interactive Interfaces
    • Teams and Organizations
  • Tutorial Videos
  • Gallery
  • Frequently Asked Questions
  • Formula Reference
  • Dynamic Commands
    • Using Dynamic Commands
    • {=} (Formula Command)
    • {button}
    • {click}
    • {clipboard}
    • {cursor}
    • {error}
    • {formdate}
    • {formmenu}
    • {formparagraph}
    • {formtext}
    • {formtoggle}
    • {if}
    • {import}
    • {key}
    • {link}
    • {note}
    • {repeat}
    • {run}
    • {site}
    • {snippet}
    • {time}
    • {user}
    • {wait}
  • Connected Snippets
    • Connected Snippets Overview
    • {image}
    • {urlload}
    • {urlsend}
    • {dbselect}
    • {dbinsert}
    • {dbupdate}
    • {dbdelete}
  • Command Packs
    • Capitalize
    • Gmail
    • LinkedIn
    • Randomize

What's on this Page

  • How to read data from websites
        • How to add a selector to a snippet
        • Reading data across multiple tabs
  • Advanced tips
    • How to shorten selected text by splitting it or using regex
    • Power conditional rules or validation
    • Different behavior based on website URL
    • Handling errors or missing data
  • Examples
Guides

Read Data from Websites

Summary: Read data from websites and from across tabs. This data can be inserted with snippets, used to power rules inside your snippet, used to fill out forms, and even manipulated using functions to get only sections that you need.

Quick Overview Video

How to read data from websites

Copying and pasting data is a waste of time, especially when the data is already available on the website where you’re using your snippets. This is common with tools like EMRs, CRMs, customer support ticketing systems, and other databases.

The {site} command allows you to read data from anywhere and use it in your snippets.

Note that if you want to retrieve data from an app or website, but you aren't using your snippet in that site or the tab with that data isn't open, the {urlload} command is more appropriate. It is also possible to retrieve text from your Clipboard or from your Text Blaze user profile automatically.

How to add a selector to a snippet

Here’s how to use the {site} command in a snippet:

  1. Click the ‘Website’ command, then click the blue ‘Select from website’ button.

  2. Go to the tab you want to read data from. Find the data you want to read. Click the data.

  3. Then, click the blue ‘Insert into snippet’ button.

  4. Go to the dashboard and click ‘Preview’ to make sure that the data is being read and pulled into your snippet.

Your browser does not support HTML video.

Now, you are using the site selector to read data and pull it into your snippet.

Here are a few important things to remember:

1. The tab you’re pulling data from must be open for the data to appear in your snippet!

2. The page must contain the data that the command is looking for in order for it to work.

3. You can use multiple selectors in a snippet.

4. Make sure you choose the correct selector (item highlighted in yellow).

5. Make sure to click ‘Insert into snippet’ after choosing a selector.

Reading data across multiple tabs

If you have more than one tab open that contains the selector in your snippet, you'll be prompted to choose the tab you want to pull from.

For example, if you have two LinkedIn tabs open, you can choose which one you want to read from with your snippet. Simply click the tab (in the snippet pop-up menu) and the data from that tab will be used in your snippet.

Advanced tips

How to shorten selected text by splitting it or using regex

Sometimes you may want only a portion of the text that is selected with this command. For instance, a website might store both the first and last name together, but you only need the first name.

Splitting the text into a list and selecting one item is one option. The example below pulls the name from the website, splits the text everywhere there's a space into a list of items and then pulls the first item in the list.

Note that the snippet below cannot be previewed here, but check the video below out to see how it works:

Splitting text using the split function
{=split({site: text; selector=[data-selenium-test="highlightTitle"]}, " ")[1]}
_

Learn more about the split function here.

Using regex, specifically the extractregex function can also help to retrieve only the specific text that you need.

Regex can be tricky to get the hang of. Learn more about regex here. If you need assistance with it, don’t hesitate to contact support@blaze.today.

Here’s an example of shortening the selection of a full name to just a first name.

Note that the snippet below cannot be previewed here, but check the video below out to see how it works:

Pulling part of a text using regex
{=extractregex({site: text; selector=[data-selenium-test="highlightTitle"]}, "(\w+)\s")}
_

Power conditional rules or validation

Sometimes it won’t be necessary to add the actual text into your snippet. Instead, Text Blaze can retrieve that text and use it to power conditional rules. By adding the website contents command inside an if/else command, Text Blaze can detect data on a page and follow the rules that you define to determine what the snippet should do.

Keep in mind that the website contents command will only work on pages that contain the selected data, so these examples won’t work in this guide.

The below snippets are examples of how to structure snippets this way. There are gifs below that show them in action.

The snippet below is meant to be used inside of Hubspot It reads the life cycle stage of the contact you are reaching out to, and then shows relevant text based on the data read from the page.

Note that the snippet below cannot be previewed here, but check the video below out to see how it works:

Reading lifecycle stage in Hubspot
{if: {site: text; page=https://app-na2.hubspot.com/*; selector=[data-selenium-test="property-input-hs_lead_status"]}="In progress"}This lead is in progress.{else}This lead is not in progress.{endif}
_

The snippet below is meant to be used inside of Zendesk when responding to a ticket.

The snippet looks at the type of customer support email (ex: problem vs incident) and provides a relevant response based on the category chosen in that field.

Note that the snippet below cannot be previewed here, but check the GIF below out to see how it works.

Reading the number of contacts in Zendesk

{if: {site: text; page=https://textblaze642.zendesk.com/; selector=.ticket_type_id [data-garden-id="dropdowns\.select"]}="Problem"}Hi {=split({site: text; page=https://textblaze642.zendesk.com/; selector=[data-test-id="omni-log-comment-user-link"]}, " ")[1]},

I'm Dylan from ACME. I'm happy to help you resolve this problem.

Would you be able to meet for a troubleshooting call?

{formparagraph}

Best regards, Dylan Customer Support - ACME {elseif: {site: text; page=https://textblaze642.zendesk.com/; selector=.ticket_type_id [data-garden-id="dropdowns\.select"]}="Incident"} Hi {=split({site: text; page=https://textblaze642.zendesk.com/; selector=[data-test-id="omni-log-comment-user-link"]}, " ")[1]},

I'm Dylan from ACME. Thank you for reporting this incident.

Our incident resolution team will be in touch soon.

{formparagraph}

Best regards, Dylan Customer Support - ACME{endif}

_
Your browser does not support HTML video.

Different behavior based on website URL

Examples up to this point have been looking at the contents of websites. Another common use-case is to have a snippet perform different actions based on the URL where the snippet is used.

Like the previous examples, doing this uses the {if} command with the {site} command inside of it.

This time, we’ll instead use the website URL option for the website command. Depending on your use, you may want to use the website path or website domain option instead.

The below snippet determines if the snippet is being used inside of LinkedIn or inside of Gmail, and results in different text being generated depending on which is true.
Greeting based on the website
{if: contains({site: url}, "linkedin")}Hi {formtext: name=firstname}, I hope you don't mind my reaching out via LinkedIn about Text Blaze.{elseif: contains({site: url}, "mail.google")}Hi {formtext: name=firstname}, I know you get a lot of emails, so I hope you don't mind one more from me.{endif}
_

Handling errors or missing data

Sometimes a website contents text command will not find matching data, or the data won’t be what the snippet was expecting.

Rather than resulting in a complete error, the catch function can replace that error with a default text of your choosing.

Adding the catch function to your snippet will display the selected text if a match is found, or will display that default value if no match is found.

Catching an error in the site selector
Here's the first contact that LinkedIn says we have in common: {=catch({site: text; selector=:nth-child(1) > strong:nth-child(1); page=https://www.linkedin.com/*}, "we don't have any contacts in common")}
_
Your browser does not support HTML video.

Examples

For examples, check out our complete workflow automation guide.

About

Plans and Pricing
Sharing Snippets
Text Blaze for Business
Forms
Autopilot
Dynamic Commands
Command Packs
Text Blaze for Windows
Text Blaze for macOS

Support

Get Started with Text Blaze
Contact Us
Documentation
Community Forum
Blog
Gallery
Engineering Blog

Solution for

Business
Customer Support
Recruiters
Education
Healthcare
Sales
Property Managers
AI

Other

Terms of Service
Privacy Policy
HIPAA Compliance
Open Source Licenses
Affiliate
© Blaze Today Inc