Skip to main content

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 a'relatively even-toned skin'] and is s'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:'' }}

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

 


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?

 


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


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 h‘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. 


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


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


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 h‘ 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.


Reply