Skip to main content
Solved

Replace Text in Code

  • September 23, 2022
  • 2 replies
  • 18 views

Hi there!

I’m looking to replace text a field with a figure from another field.

I can get this to work if I reference the code via another field but I can’t figure out how to insert it via a formula (so that I don’t have to fill a field with this dummy data every time).

Not too familiar with markdown/the symbology etc sorry!

Best answer by Kamille_Parks11

Your text includes double quotes, so your formula breaks when it gets to plotWidget because its’ wrapped in double quotes and is interpreting the first quote as the end of the first argument in your Substitute function.

Try using single quotes to enclose your HTML.

SUBSTITUTE(
'<span id="plopWidget"></span>...',
"XXX",
{product_id}&""
)

2 replies

Kamille_Parks11
Forum|alt.badge.img+27

Your text includes double quotes, so your formula breaks when it gets to plotWidget because its’ wrapped in double quotes and is interpreting the first quote as the end of the first argument in your Substitute function.

Try using single quotes to enclose your HTML.

SUBSTITUTE(
'<span id="plopWidget"></span>...',
"XXX",
{product_id}&""
)

  • Author
  • New Participant
  • September 23, 2022

Your text includes double quotes, so your formula breaks when it gets to plotWidget because its’ wrapped in double quotes and is interpreting the first quote as the end of the first argument in your Substitute function.

Try using single quotes to enclose your HTML.

SUBSTITUTE(
'<span id="plopWidget"></span>...',
"XXX",
{product_id}&""
)

You’re the best, thanks so much