Skip to main content
spencer_engel
Expert ⭐️
December 19, 2019

How to create a URL in the Rules Engine

  • December 19, 2019
  • 20 replies
  • 2095 views

Today’s tutorial covers how to create URLs in the Rules Engine. A good use case for this, as I describe in the video, is if you need to tokenize links to multiple Salesforce records in the CTA comments or scorecard comments. In my example, I tokenize links to two Opportunity Products and then include those in the CTA comments. 

 

 

The guide for how to put these URLs together can be found via this link: 
https://www.w3schools.com/tags/att_a_href.asp. The instructions are to use the concatenate formula field in a transformation task, then put in the following code: 

 

<a href=”  

hit enter

Input your URL - in my case it was https://na85.salesforce.com/

hit enter

Then tokenize whatever it is you want to link to; in my case the opportunity product ID

hit enter

“>

hit enter

Type in the text you want the link to display; in my case “Link to Product”

hit enter

</a>

hit enter and save

 

Let me know if you have any questions! 

20 replies

sai_ram
Expert ⭐️⭐️
December 24, 2019

Thanks for posting this here!

Contributor ⭐️⭐️⭐️
April 13, 2021

Hi @spencer_engel is this logic still supposed to work? I know this is a year out of date. I attempted this, but what ends up happening is all the html code gets displayed in the output. When I just concatenate my URL and my tokenized value the URL works, but I would prefer if it didn’t display the entire URL, but rather the text I’d like.

spencer_engel
Expert ⭐️
April 14, 2021

Hi @spencer_engel is this logic still supposed to work? I know this is a year out of date. I attempted this, but what ends up happening is all the html code gets displayed in the output. When I just concatenate my URL and my tokenized value the URL works, but I would prefer if it didn’t display the entire URL, but rather the text I’d like.

As far as I know that solution should still work, but I admittedly haven’t tried it for a while. Thinking outside the box, if your concatenated field works, maybe you could do one more transformation on that field and do a case expression with the logic being “if URL starts with HTTP, then transform to a custom string field of (insert text here)”...thoughts?

Helper ⭐️
February 10, 2022

I’m not sure if this is a Gainsight NXT difference but I was having issues getting the Concat field to save. In case anyone else has run into this issue, It worked once I changed the closing expression from “</a>” to “/a>”.

 

Edit: The above caused the rule action to fail. Below is the setup in Gainsight NXT that I was able to get to work in both the task configuration and the Action.

 

Concat(<a href=",https://URL/,Opportunity ID,/view,">,Link to Opportunity,<,/a>)

 

Another thing I had to change was make the destination field in Data Management a String NOT a URL. It is still a clickable link as a string in reports.

Contributor ⭐️⭐️⭐️
February 10, 2022

Yes, I had the same issue a few weeks ago, even though I have an existing rule running that works fine. But I can’t save this logic in a new rule.

Helper ⭐️
February 10, 2022

@kytpowell I wanted to alert you to my edit. I was able to get the clickable link to work in rules engine by changing my field to a string from a URL in Data Management and splitting the “<” and “/a>”per the below.

 

Concat(<a href=",https://URL/,Opportunity ID,/view,">,Link to Opportunity,<,/a>)

sarahmiracle
VIP ⭐️⭐️⭐️⭐️⭐️
April 6, 2022

@jkolle thank you for your extra insights here!

 

I’m still running into issues. My action is loading to a String field. The issue I’m seeing is that it looks like a clickable link, but it is not clickable and not linked.

Here is my concat & screenshot from my report where I’m trying to click on it. What is strange, is that in my preview of the transform task step in a successful rule, it is clickable (last screenshot)

 

Here’s what’s happening in my rule result export:

 

Customer Success Systems Admin @ Amplitude, 3x Gainsight CS Ops Product Council Member
sarahmiracle
VIP ⭐️⭐️⭐️⭐️⭐️
April 6, 2022

Fixed -- copying/pasting the web address was causing extra spaces at the end of it in the concat. I typed it out by hand and then it worked

Customer Success Systems Admin @ Amplitude, 3x Gainsight CS Ops Product Council Member
Contributor ⭐️⭐️⭐️
June 16, 2022

hey, i tried similar way but it does not work rather it shows whole in export CSV.Can you plz advise

 

Contributor ⭐️⭐️⭐️
June 17, 2022

@jkolle / @sarahmiracle , can you please advise? Thanks