Skip to main content
Solved

Insert property variable in text block shows quotes and brackets within emails


Forum|alt.badge.img+3

Hi,

I am using the results of a quiz to customize an email. I am able to retrieve the quiz data using property variables. But when the email gets sent, the variables show up with square brackets and quotes as shown below. How do I get rid of these?

Here’s what the sent email shows:

Your skin has ['relatively even-toned skin'] and is ['not prone to breakouts']

Here’s what I have in the text editor:

Your skin has {{ person|lookup:'When you look at your face in the mirror do you find'|default:'' }} and is {{ person|lookup:'Your skin is ..'|default:'' }}

Best answer by Omar

My suggestion would also be to get this fixed on the source of where this is happening.

Just to be sure, is this data field created as a list or text field? That might have something to do with it. Text field that tries to store a list or the other way around.

If you're not able to fix it and want to use the content in the mails you might want to look at this Django option where you can cut out unwanted characters

https://docs.djangoproject.com/en/4.0/ref/templates/builtins/#cut

 

Regards,

Omar Lovert

Polaris Growth

View original
Did this topic or the replies in the thread help you find an answer to your question?

7 replies

alex.hong
Forum|alt.badge.img+58
  • Klaviyo Alum
  • 1552 replies
  • March 21, 2022

Hi there @Scgluwa,

Thanks for posting to the Community.

In order to better assist, can you please share some screenshots of the campaign/flow setup for the messages as well as the preview email and what the expected result would be for an example customer (making sure to omit any personal info)? My guess is that the method your quiz results are stored is that they are saved as [‘ xyz ‘] and that might be leading to the variable syntax pulling that in from a user’s profile. By sharing that data screenshot, we can see how things are being formatted and take a closer look.

 

Thank you,
Alex

 


Forum|alt.badge.img+3
  • Author
  • Contributor I
  • 2 replies
  • March 22, 2022

Thank you Alex. 

You are right. The variables are indeed being stored that way by the quiz. How do I strip out the brackets and quotes?

 


alex.hong
Forum|alt.badge.img+58
  • Klaviyo Alum
  • 1552 replies
  • March 22, 2022

Hi there @Scgluwa,

Glad we could find the culprit. 

I think that would have to depend on what integration you use to collect quiz data so I would recommend you first check the support team/help doc whatever form collection tool you are using and see what the issue might be there and then report back your findings.

 

All the best,

Alex


Forum|alt.badge.img+1
  • Contributor I
  • 1 reply
  • June 12, 2022

Hi, I’m actually having the same exact problem. No matter which way I input the name in the VALUE column, it always comes through the email with [‘brackets’]. And the data collection I’m using is the Klaviyo flyout form I built in-app. 

This has completely stumped me, I’ve tried inputing the Value in every way I can think of. With/without brackets, quotes, initial caps, lowercase, apostrophes, and on and on. 


alex.hong
Forum|alt.badge.img+58
  • Klaviyo Alum
  • 1552 replies
  • June 13, 2022

Hi @hkelley,

Do you mind sharing screenshots of what the property is collected as in your account + on an example profile? As well as the syntax for how you are inserting this into an email?

Thank you,

Alex


Omar
Partner - Platinum
Forum|alt.badge.img+46
  • 2025 Champion
  • 494 replies
  • Answer
  • June 13, 2022

My suggestion would also be to get this fixed on the source of where this is happening.

Just to be sure, is this data field created as a list or text field? That might have something to do with it. Text field that tries to store a list or the other way around.

If you're not able to fix it and want to use the content in the mails you might want to look at this Django option where you can cut out unwanted characters

https://docs.djangoproject.com/en/4.0/ref/templates/builtins/#cut

 

Regards,

Omar Lovert

Polaris Growth


Forum|alt.badge.img
  • Contributor I
  • 2 replies
  • September 19, 2023

Adding to this thread as have also encountered this issue - this time with Klaviyo / Shopify inbuilt variables.  in inserting the dynamic variable: {{ event|lookup:'Discount Codes'|lookup:'0'|default:'' }} which retrieves the discount code assigned to the profile, this also comes through [‘ discount code ‘]. when simply including it within an abandoned cart flow.

these discount codes are created by klaviyo / shopify - therefore the data storage cannot be changed, however frustrating when trying to simply print out the discount code value.

 

I haven’t found a solution to this, as all other metrics appears to print out without the square brackets.