Insert data from a table column if site info matches another column

Hi everyone,

I work in customer service and I’m trying to improve how I personalize my replies using Text Blaze.

Currently, I have a snippet that captures the customer’s name using the CSS selector and inserts it into a greeting. However, there’s a problem: anyone on my team can edit customer contact details, and sometimes names are saved incorrectly or with extra information. For example:

  • Fleet Driver - Driver's Name - License Plate
  • Outsourced driver - Driver's Name - License Plate

To handle this, I’m using a simple regex to clean up the name. So my snippet outputs something like:

Good morning, John Doe, how are you? I will check your request.

instead of:

Good morning, Outsourced driver John Doe TRU658, how are you? I will check your request.

Snippet contents.

That works reasonably well, but it’s not perfect—especially when the name itself is wrong due to typos.

So I’m wondering if there’s a better approach using Data Blaze.

If I create a table with columns like Name and Phone Number, would it be possible for the snippet to:

  • Check the phone number from the website selector
  • Match it with the Data Blaze table
  • Insert the correct name from the table instead of relying on the website value

For example:

  • If phone number 123456 sends a message → insert John Doe (even if the website shows a typo like “Jonah Deo”)
  • If phone number 789101 sends a message → insert the corresponding correct name

Is this kind of lookup possible in Text Blaze/Data Blaze? If so, what would be the best way to implement it?

Thanks in advance for any guidance!

1 Like

Hi Syrthmas,
Sure, here's how you do it

Phone number: {formtext:name=number;default=5555555555}
{dbselect: SELECT Name FROM Table1 WHERE phone=@number; space=id; menu=no}
Name: {=Name}

Hi Syrthmas,

Thanks for bringing up this case - it actually gave me a new idea for improving my workflow with CSS selectors.

Hello,

I think I’ve figured out what I want, something more like this:

Name Telephone
John Smith 5555555555
Sally Johnson 6666666666

{phone_number={site: text; page=https:examplepage.com{{^^%2F^^}}*; selector=.text-no-wrap > .copyable-text}}
{dbselect: SELECT Name FROM Table1 WHERE contains(Telephone, `@phone_number`); space=4laSnE0ItnOYYu9vXrtvws; menu=no}
Good morning, {=name}, how are you? I will check your request.

However, since each person in my table has a unique phone number, is it possible to disable the pop-up and have the snippet automatically insert the name in the text?

1 Like

Unfortunately, that's not possible. Calling Data Blaze takes a bit of time, and therefore the pop-up is required.