Read Data from Websites
Quick Overview VideoHow 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:
Click the ‘Website’ command, then click the blue ‘Select from website’ button.
Go to the tab you want to read data from. Find the data you want to read. Click the data.
Then, click the blue ‘Insert into snippet’ button.
Go to the dashboard and click ‘Preview’ to make sure that the data is being read and pulled into your snippet.
Now, you are using the site selector to read data and pull it into your snippet.
Here are a few important things to remember:
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:
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.
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:
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.
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:
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.
{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}
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.
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.
Examples
For examples, check out our complete workflow automation guide.