Add clickable link in Email body of a Email action in Flow Designer

ChrisWing
Mega Guru

I am really struggling to find a solution to this and given the potential uses for it I can't believe it isn't simpler to use so I am hoping I am just missing something.

 

I have a Flow in which I generate an email to an individual.  There is a variable that is gathered part way through the workflow that needs to be picked up and delivered to the recipient of the email.  I have a variable on the preceding task (URL type) that is filled in by the group doing the work.  Then in the email I add the Data Pill but it just comes out as straight text.  I can't seem to fathom a way to convert it to a href.  On the net I saw some people doing it via Flow Variables but they were choosing the options Data for type of variable and in Yokohama that no longer seems to be an option.  Is anyone able to help me figure this one out?

2 ACCEPTED SOLUTIONS

Roshnee Dash
Tera Guru

Method 1: Use a String Flow Variable with HTML

  1. Create a Flow Variable

  2. Set the Variable
    Use the "Set Flow Variables" action to populate this variable dynamically using the record's sys_id.
  3. Insert into Email
    In the Send Email action:

    • Switch the body to HTML mode.
    • Insert the variable like this:Please review the record: @{LinkVariable}
 

Method 2: Use Built-in Tokens like ${URI} or ${URI_REF}

If you're using email notifications (not Flow Designer's "Send Email" action), you can use:

  • ${URI} → Inserts a link with the text "LINK"
  • ${URI_REF} → Inserts a link with the record's display value as the link text

These work well in Notification Templates, but not directly in Flow Designer emails 

Your feedback makes the community stronger! If you found this helpful, marking it as the correct answer helps others.
Stay awesome,
Roshnee Dash

View solution in original post

Chaitanya ILCR
Kilo Patron

Hi @ChrisWing ,

check my response in the below thread

https://www.servicenow.com/community/developer-forum/add-ritm-hyperlink-in-send-email-action/m-p/321...

 

Please mark my answer as helpful/correct if it resolves your query.

Regards,
Chaitanya

View solution in original post

7 REPLIES 7

Roshnee Dash
Tera Guru

Method 1: Use a String Flow Variable with HTML

  1. Create a Flow Variable

  2. Set the Variable
    Use the "Set Flow Variables" action to populate this variable dynamically using the record's sys_id.
  3. Insert into Email
    In the Send Email action:

    • Switch the body to HTML mode.
    • Insert the variable like this:Please review the record: @{LinkVariable}
 

Method 2: Use Built-in Tokens like ${URI} or ${URI_REF}

If you're using email notifications (not Flow Designer's "Send Email" action), you can use:

  • ${URI} → Inserts a link with the text "LINK"
  • ${URI_REF} → Inserts a link with the record's display value as the link text

These work well in Notification Templates, but not directly in Flow Designer emails 

Your feedback makes the community stronger! If you found this helpful, marking it as the correct answer helps others.
Stay awesome,
Roshnee Dash

Hey @Roshnee Dash 

So I have to follow Method 1 as I am not doing a notification, but rather the Email Action.  

 

3. switch the body to HTML mode......Where is that capability. I can switch to scripting but there is nothing to dictate that the body should be HTML.

ChrisWing_0-1748445976749.png

 

You can click on the insert link icon and add the url.

Your feedback makes the community stronger! If you found this helpful, marking it as the correct answer helps others.
Stay awesome,
Roshnee Dash

@ChrisWing, Roshnee1's answer was correct, you just forgot to do steps 1 & 2, which are to create and set a flow variable 🙂 

The flow variable is the one that will contain the full HTML code for the link that will be referred to in the Email Action. 

PascalVerdieu_2-1748868174676.png

 

When filling in the Flow Variables, I will usually use a quick script to generate the HTML code.  Here's what it looks like

PascalVerdieu_0-1748867421900.png

and here's the actual code.

var retTxt = '<a href="';
retTxt += gs.getProperty('glide.servlet.uri') + gs.generateURL('kb_knowledge', fd_data._1__look_up_record.record.sys_id); //Replace with your actual URL
retTxt += '">';
retTxt += fd_data._1__look_up_record.record.number; //Replace with what you want the user to see
retTxt += '</a>';
return retTxt;

Line 2 is the URL (which in this case refers to a KB in the instance), line 4 will be the text shown to the user.  Of course, you can play as you wish with one or the other.  From what I see, you're linking to OneDrive, so line 2 would look like retTxt += fd_data.20__Get_Cat...

 

Then in your email action, just refer to the Flow Variable

PascalVerdieu_1-1748868146358.png

HTH