Skip to main content
Solved

How to include quotation marks in the formula field


I want to generate HTML code for a link so I can merge a URL into an email. So I need something like:

“<a href=” &""" & {Article URL}& “”" & “>article”

But this doesn’t work. Is there a way to ensure that the formula can produce a "?

Best answer by Alexey_Chekano1

You can also use \\" to include quotation mark to the formula. For example, if you’d like to add quotes around Name field when concatenating, you can use Concatenate(SomeField, "\\"", Name, "\\"").

View original
Did this topic help you find an answer to your question?

11 replies

  • Known Participant
  • 18 replies
  • March 14, 2017

well I found a solution but it ain’t pretty.

I created a field named “quote”, then filled all the records with ", then used concatenate. worked like a charm.


Forum|alt.badge.img+3
  • Participating Frequently
  • 30 replies
  • March 14, 2017
Klaus_Becker wrote:

well I found a solution but it ain’t pretty.

I created a field named “quote”, then filled all the records with ", then used concatenate. worked like a charm.


Can you try “”" ? Same for ‘’’. You can also do “’” (double quotes around a single quote) and ‘"’(single around double), but those are less general.


  • Known Participant
  • 18 replies
  • March 14, 2017
Alexander_Sorok wrote:

Can you try “”" ? Same for ‘’’. You can also do “’” (double quotes around a single quote) and ‘"’(single around double), but those are less general.


wow, nice! much easier than my solution ^^


  • Author
  • Participating Frequently
  • 7 replies
  • March 14, 2017

Thanks for those ingenious solutions. I like your workaround Klaus, but Alexander’s code looks the simpler. It’s good to have a back stop.


  • Author
  • Participating Frequently
  • 7 replies
  • April 16, 2018
Alexander_Sorok wrote:

Can you try “”" ? Same for ‘’’. You can also do “’” (double quotes around a single quote) and ‘"’(single around double), but those are less general.


Those don’t seem to work for me. I had to back to creating a “quote” field and concatenating it.


  • New Participant
  • 4 replies
  • April 16, 2018

I had a similar issue, I found a support about a bug around this. I ended up putting quotes around my link text and using:
"<a href="&{URL}&">link here</a>"


Forum|alt.badge.img+5
  • Inspiring
  • 1386 replies
  • April 19, 2018

That’s odd.

In tests, both of these worked:

'<a href="'&URL&'">Click here</a>'
"<a href=\\""&URL&"\\">Click here</a>"

Because of @Chester_McLaughlin’s bug report from a while back, I tested using a lookup field and a single-select value for {URL}, and both worked, as well. (I also embedded a double quote in the middle of {URL} — an impossibility, I know — to test Chester’s scenario, and the formula functioned properly.)

Anyone still having problems with this, could you post a copy of the formula that failed? (Enclose the code in backticks like this mark here ` or precede it on a new line with 4 spaces to make sure the forum doesn’t reformat your quotation marks.)

Thanks.


  • Author
  • Participating Frequently
  • 7 replies
  • April 19, 2018
W_Vann_Hall wrote:

That’s odd.

In tests, both of these worked:

'<a href="'&URL&'">Click here</a>'
"<a href=\\""&URL&"\\">Click here</a>"

Because of @Chester_McLaughlin’s bug report from a while back, I tested using a lookup field and a single-select value for {URL}, and both worked, as well. (I also embedded a double quote in the middle of {URL} — an impossibility, I know — to test Chester’s scenario, and the formula functioned properly.)

Anyone still having problems with this, could you post a copy of the formula that failed? (Enclose the code in backticks like this mark here ` or precede it on a new line with 4 spaces to make sure the forum doesn’t reformat your quotation marks.)

Thanks.


Thanks. That works well now.


  • Participating Frequently
  • 9 replies
  • June 9, 2020
W_Vann_Hall wrote:

That’s odd.

In tests, both of these worked:

'<a href="'&URL&'">Click here</a>'
"<a href=\\""&URL&"\\">Click here</a>"

Because of @Chester_McLaughlin’s bug report from a while back, I tested using a lookup field and a single-select value for {URL}, and both worked, as well. (I also embedded a double quote in the middle of {URL} — an impossibility, I know — to test Chester’s scenario, and the formula functioned properly.)

Anyone still having problems with this, could you post a copy of the formula that failed? (Enclose the code in backticks like this mark here ` or precede it on a new line with 4 spaces to make sure the forum doesn’t reformat your quotation marks.)

Thanks.


Ugh, can’t seem to get this to work. :grimacing: I have tried all of the above.

The most recent attempt is:

'<a href="'&{URL}&'">Click here</a>'

The URL field doesn’t contain quotes.

This formula field is then pulled into a SendGrid block.

When I look at the source code of the email after sending it, I see the quotes are always being converted to &quot

Any help would be appreciated.


  • Participating Frequently
  • 9 replies
  • June 11, 2020
Kevin_Murray wrote:

Thanks. That works well now.


Really stuck on this. Is this still working for you?


Forum|alt.badge.img+1

You can also use \\" to include quotation mark to the formula. For example, if you’d like to add quotes around Name field when concatenating, you can use Concatenate(SomeField, "\\"", Name, "\\"").


Reply