Thanks for being a part of the Klaviyo Community! I’m sure other members who may be having the same questions will find your comments and solution helpful!
David
Thanks David - very helpful - I will read up on that, too.
(In fairness, I had some help to come up with the right syntax here - it was a bit of a trial and error with support as well, but we got it, and Im excited that it’s working!)
Hello! Would you know what’s the syntax if the lookup condition is text?
If you were trying to use a show/hide function to evaluate if the event|lookup:’event.Items.0’ variable equaled “Weighted_Blanket”, I believe you’ll want to use the ’PROPERTY’ in event.variable format since the event|lookup:’event.Items.0’ variable seems to be in a list/array data type.
As mentioned in both the How to show or hide template blocks based on dynamic variables classic editor and new editor Help Center articles: How your data is stored will influence which show/hide conditions will work for you. Learn how to identify data types in your own account.
Comparison operators would only be used for returning true or false statements which are typically for data points stored as text, number, date, or boolean data types - not lists/arrays.
David
Hello @David To,
Super appreciate your response. I apologize as my coding skills are limited. I tried the following and it says my variables/ syntax is incorrect.
“WEIGHTED_BLANKET” in 'event.Items' “WEIGHTED_BLANKET” in event|lookup:'event.Items'
I’m using the new editor.
Thanks so much!
Hey @Keslie,
That error message you’re seeing is usually very helpful as it is calling out either the format of your condition is incorrect and/or your syntax and variables are incorrect.
Did you happen to create the condition somewhere else and then proceeded to copy and paste the condition in the show hide/display menu of the template? If you are, it’s typically best practice to either type out the condition manually or copying and pasting the condition without formatting. I’ve seen this occur a number of times where you’ll actually be accidentally pasting in some additional formatting without realizing as I’ve explained prior in the below Community post which would include variables and syntaxes that are not recognized through the template editor:
If you’re still having troubles, you may want to reach out and speak to your own email designer or even reaching out to our Support colleagues to see if they can spot anything that you may have missed through your template.
David
It finally worked! Thank you so much, @David To! The articles you suggested really helped a lot.