Using Text Blaze with Salesforce - Questions, Tips, Snippets and Advice

@roy_vaixel Here is a list I've pulled together of some regex extract code, time/date code and basic autopilot code that works for us in Salesforce Lightning. Hope this helps!

Contact Name from Case: {=extractregex({site: text}, "[\s\S]*\nContact Name\n(.+)")}

Contact Number from Case: {=extractregex({site: text}, "[\s\S]*\nCV StuNum\n(.+)")}

Contact Phone from Case: {=extractregex({site: text}, "[\s\S]*\nContact Phone\n(.+)")}

Contact Email from Case: {=extractregex({site: text}, "[\s\S]*\nContact Email\n(.+)")}

Contact Personal Email from Case: {=extractregex({site: text}, "[\s\S]*\nContact Personal Email\n(.+)")}

Contact Number from Case: {=extractregex({site: text}, "[\s\S]*\nCase Number\n(.+)")}

Case Subject from Case: {=extractregex({site: text}, "[\s\S]*\nSubject\n(.+)")}

Case Description from Case: {=extractregex({site: text}, "[\s\S]*\nDescription\n(.+)")}

Case Team from Case: {=extractregex({site: text}, "[\s\S]*\nCase Team\n(.+)")}

Case Owner from Case: {=extractregex({site: text}, "[\s\S]*\nCase Owner\n(.+)")}

Save (works on Windows & Mac): {key: ctrl-s; mac=cmd-s}

Select All (works on Windows & Mac): {key: ctrl-a; mac=cmd-a}

Tab Backwards (works on Windows & Mac): {key: shift-tab; mac=shift-tab}

Date at Time: {time: M/D [at] h:mm A}

Go to Task: {key:ctrl-alt-g}{wait: delay=.1s}{key:p}

Go to Sub Tab: {key:ctrl-alt-g}{wait: delay=.1s}{key:s}

Salesforce Workspace Tab (Contact Name): {site: text; selector=body > div.desktop.container.forceStyle.oneOne.navexDesktopLayoutContainer.lafAppLayoutHost.forceAccess.tablet > div.viewport > section > div.navexWorkspaceManager > div > div.tabsetHeader.slds-context-bar.slds-context-bar--tabs.slds-no-print > div.slds-context-bar__secondary.navCenter.tabBarContainer > div > div > ul.tabBarItems.slds-grid > li.oneConsoleTabItem.tabItem.slds-context-bar__item.slds-context-bar__item_tab.slds-is-active.active.hasActions.hideAnimation.slds-has-sub-tabs.navexConsoleTabItem > a > span.title.slds-truncate}

1 Like

Hey Brad, thanks so much for providing this! I am having an issue with a the Contact Email from Case snippet. It is results with [Error - No match found.] rather than the contact email. Any idea how to fix this one? Thanks in advance, I absolutely LOVE textblaze. Currently trying to convince my company to purchase a business account with you all. Cheers!

1 Like

Hi @Jack_Orman! Great to hear from you. Glad to help! If you wouldn't mind please, reply with a screenshot of a sample Case screen so I can see what you are working with. I bet that we can figure this out!

Keep Blazing :fire:!
-Brad

Looking into it - Stay tuned!

Question - Which version of Text Blaze are you using?

I am using Textblaze Pro

1 Like

Great! And to clarify your need, you are wanting the customers email address to populate where the error message is showing?

Yes exactly. I would also like to be able to pull the customer phone number from case details as well, that one is also prompting the same error message

1 Like

Try this code instead. It changes the name of the field to look for, to match what your screenshot shows.

Pull Email Address:
{=extractregex({site: text}, "[\s\S]*\nEmail Address\n(.+)")}

To pull the phone number, try replacing the contents of the regex code to be what the label of phone number field is within your build of Salesforce.

Does that help?

Ah that totally fixed the email problem! Thank you!!
However when I made that change for the phone, it seems to work when I am pulling restaurant phone number but when I try to combine the snippet with another extracting the contact number it prompts Click to dial disabled rather than then umber

1 Like

image

The empty fields on the left of the phone number section seems to just autofill in as well if there isn't a phone number for the account

1 Like

Great news!! Glad that worked for you!

I know what you mean about the phone field resulting in Click to dial disabled rather than then number. My team runs into that as well...but only if they are not logged into the system that enables the click to dial feature. Let's try this. If you wouldn't mind please, paste in a reply, the Text Blaze snippet code you are using. I'll copy it from there and troubleshoot within my instance of Salesforce.

No problem, thank you for looking into this! Amazing customer support.

{=extractregex({site: text}, "[\s\S]\nContact Name\n(.+)")}
{=extractregex({site: text}, "[\s\S]
\nEmail Address\n(.+)")}
{=extractregex({site: text}, "[\s\S]\nContact Mobile\n(.+)")}
{=extractregex({site: text}, "[\s\S]
\nRestaurant Phone\n(.+)")}

1 Like

It seems to be putting filling in "Escalated Support" or "Flex Pricing" where it should be extracting the phone number

Hmm - Let's take a slightly different approach to the solution. Let's see if converting the fields to "variables" solves the problem. Check this out. Put the following at the top within the snippet edit window.

{note}
{ContactName=extractregex({site: text}, "[\s\S]\nContact Name\n(.+)")}
{EmailAddress=extractregex({site: text}, "[\s\S]
\nEmail Address\n(.+)")}
{ContactMobile=extractregex({site: text}, "[\s\S]\nContact Mobile\n(.+)")}
{RestaurantPhone=extractregex({site: text}, "[\s\S]
\nRestaurant Phone\n(.+)")}
{endnote: trim=right}

Wrapping all that within the "note", will prevent all that from inserting when you run the snippet. Next, where you actually want the output of the snippet to go, insert the respective variables you just made above. Here's an example:

Hi {=contactname},

Please confirm your contact info as follows:
{=emailaddress}
{=contactmobile}
{=restaurantphone}

Here's what it should look like all put together:

{note}
{ContactName=extractregex({site: text}, "[\s\S]\nContact Name\n(.+)")}
{EmailAddress=extractregex({site: text}, "[\s\S]
\nEmail Address\n(.+)")}
{ContactMobile=extractregex({site: text}, "[\s\S]\nContact Mobile\n(.+)")}
{RestaurantPhone=extractregex({site: text}, "[\s\S]
\nRestaurant Phone\n(.+)")}
{endnote: trim=right}

Hi {=contactname},

Please confirm that we have your correct contact information on file as follows:
{=emailaddress}
{=contactmobile}
{=restaurantphone}

@Cedric_Debono_Blaze Hello Cedric! Tagging you in here in hopes that you can help our friend @Jack_Orman. I have troubleshooted with him extensively but there seems to be something missing. Hoping you can help!

Sorry about the delay there, I was at my max for allowed messages on the first day. That seems to work, however I am still getting the Click to Dial button for the contact mobile.

Just had an idea @Jack_Orman. I tested it in my Salesforce environment and it works! Let's try yours!

  1. Right-click on the phone number.
  2. Select "Inspect" from the menu.
  3. When the Inspector window opens, it will automatically highlight a specific row of code.
  4. Right-click on that highlighted code.
  5. Choose "Copy Selector" from the menu.
  6. Close the inspector by pressing F12.
  7. Go to the snippet contents I shared with you and change the ContactMobile line to be as follows:

{ContactMobile={site: text; PASTE THE CODE YOU COPIED HERE}}

Note!!! Make sure you keep both "}}" on the end there!

You should end up with something that looks like this:
{ContactMobile={site: text; selector=#sectionContent-236 > div > slot > force-record-layout-row:nth-child(6) > slot > force-record-layout-item:nth-child(2) > div > div > div.slds-form-element__control > span > slot:nth-child(1) > slot > lightning-formatted-phone > a}}

Let us know how it goes!!

Ok I followed those instructions and that doesn't seem to fix the issue either :confused: I will attach a screenshot of what it produces

image

Maybe @Gaurang_Tandon has some suggestions?