I was trying to make specific blocks in a template show or hide based using the condition structure:
person|lookup:'Account_Owner'=’Martin Dee’
In this instance ‘Account_Owner’ is a custom variable stored in the list and ‘Martin Dee’ would be one of the values used in that varaible. I could not get the system to accept this condition as being valid and I got an error message every time I tried to save it.
In the end I got the template working successfully using the condition structure of:
'Martin' in person|lookup:'Account_Owner'
But, I’d still like to understand what I was doing wrong in the first example. Can anyone explain it to me please?
Best answer by Dov
Hello @Martin_Dee,
Thank you for sharing this with our Klaviyo Community. I am glad to hear that you were able to get the logic working through some experimentation.
Yes, happy to explain. Since you have multiple values stored for the custom property “Account_Owner”, you are working with a list data type. The former condition structure: (person|lookup:'Account_Owner'=’Martin Dee’) will only work for text (string) or number data types. When working when list data, you need to use the latter condition structure which calls out the value in the custom property at the beginning of the statement ('Martin' in person|lookup:'Account_Owner'). If you look at the conditional structures portion of our documentation, you’ll see some examples with acceptable data types per condition in the chart, including these two scenarios.
Thank you for sharing this with our Klaviyo Community. I am glad to hear that you were able to get the logic working through some experimentation.
Yes, happy to explain. Since you have multiple values stored for the custom property “Account_Owner”, you are working with a list data type. The former condition structure: (person|lookup:'Account_Owner'=’Martin Dee’) will only work for text (string) or number data types. When working when list data, you need to use the latter condition structure which calls out the value in the custom property at the beginning of the statement ('Martin' in person|lookup:'Account_Owner'). If you look at the conditional structures portion of our documentation, you’ll see some examples with acceptable data types per condition in the chart, including these two scenarios.
That makes sense and I should have thought of it! Thank you for a clear explanation, I’ll watch out for data types in the future
Search saves time. Contributing compounds value.
The ROI of your reply? One helpful answer can support dozens of teams, build your credibility, sharpen your own expertise over time, foster connectivity, and create good karma – because what goes around comes around. The community is what YOU make it.