Email URL with ampersand

e_wilber
Tera Guru

I can't for the life of me get a simple link to work in a mail script.

var prefix = "<a href='" + gs.getProperty('glide.servlet.uri');
var main = "/acs?id=public_survey&instance_id=" + current.sys_id;
var last = "'>Click here to take your survey</a>";

template.print(prefix + main + last);

This produces the url: https://instance.service-now.com/acs?id=public_survey&amp;instance_id=3fdb0cd61b3df3009830433fbd4bcb4e

The link doesn't work with &amp; in it. When I update the link to just &, the link works great.

I tried using var main = "/acs?id=public_survey%26instance_id=" + current.sys_id; but that doesn't work, either.

How do I force the ampersand to stay exactly as it is in my link?

 

6 REPLIES 6

Hi,

If you don't mind, can you create a new post with your question?

Please feel free to mention me with the @ symbol and my name: Allen A

Thanks!

Please mark reply as Helpful, if applicable. Thanks!


Please consider marking my reply as Helpful and/or Accept Solution, if applicable. Thanks!

Morrie Glaich
Tera Contributor

Keeping this thread alive in the hopes someone may have found a solution to this?