Skip to main content
spencer_engel
Expert ⭐️
Dec 19, 2019 5:41 PM UTC

How to create a URL in the Rules Engine

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

sarahmiracle
VIP ⭐️⭐️⭐️⭐️⭐️
Jun 17, 2022 9:28 PM UTC

@Syed what do you mean it shows whole in the export? Can you share an example of what your export looks like?

Translate
Customer Success Systems Admin @ Amplitude, 3x Gainsight CS Ops Product Council Member
Contributor ⭐️⭐️⭐️
Jun 20, 2022 4:09 AM UTC

@sarahmiracle , i mean in output, wen i test the rule. It shows like below:

 

Translate
Helper ⭐️
Jun 20, 2022 6:13 PM UTC

@Syed That’s correct, the export will show the URL but in the tool and report builder you will see the formatted text in a clickable link. If you add the field to a report and export it will show the full url. I confirmed in my instance the same behavior.

Translate
Contributor ⭐️⭐️⭐️
Jul 5, 2022 6:58 AM UTC

@jkolle thanks for your help.Its working fne but in order to URL to work, i do right click and open in new tab.Is there anyway, if we can do with one click?thanks

Translate
Contributor ⭐️⭐️⭐️
Jul 5, 2022 8:34 PM UTC

hi 

Currently, i am using like this

Concat(<a href=",https://lightning.force.com/,Record ID, target="_blank", ”>,Link,<,/a>

 

Translate
sarahmiracle
VIP ⭐️⭐️⭐️⭐️⭐️
Sep 19, 2022 9:44 PM UTC

Hi all - I wanted to share that I ran into an issue with this solution after the new Data Operations was introduced. The new Data Operations now has a validation step for String values that will not allow you to save updates made in Data Operations when you have String field values that exceed a certain character limit. I have 11 fields that I use this ^ solution for and use Rules Engine to populate the field value, which works successfully. This now means that using this solution means I cannot use Data Operations at all, as all of these fields will hit that same error.

I’m submitting a ticket to Support, but I wanted to raise here as well because I believe you will all be in the same boat.

Translate
Customer Success Systems Admin @ Amplitude, 3x Gainsight CS Ops Product Council Member
Contributor ⭐️
Jan 10, 2023 10:20 PM UTC

@sarahmiracle - I had the same issue as you, where it creates what looks like a clickable link, but you can’t click it. I even tried what you did and typed out the URL in case a space was causing an issue, but it was still not working. 
I am using Gainsight NXT. I am creating the hyperlink via a rule and writing it to a string field. 
 

Concat Formula in Rule
Report view of output looks like you can click it but nothing happens

Any suggestions would be helpful! 

Translate
Contributor ⭐️⭐️⭐️⭐️
Jun 23, 2023 6:59 AM UTC

Hi Team,

I am creating milestone activities via rule and trying to insert a URL into notes section and this solution doesn’t work.. Any suggestions?

 

 

Translate
Expert ⭐️
Jun 23, 2023 10:16 PM UTC

Got this to work with two adjustments.

 

  1. I add the <p> tags
  2. I have the target="_blank" piece added in

 

 

 

I dont think the target blank is needed as that’s to open in a new tab.

 

Something I noticed on yours also

 

 

Translate
Contributor ⭐️
Nov 7, 2023 11:38 AM UTC

Very useful post

Translate