Solved

Using if statements in metric flow

  • 16 June 2021
  • 2 replies
  • 72 views

Badge

I’m creating a metric flow in Klaviyo and have an event variable, amount_dollars, that gets sent with each payload. Within an email that triggers off of the flow, I want to change one word depending on how large amount_dollars is; e.g. I want it to say “extremely” if amount_dollars is greater than 500. I tried writing the following into my email within the flow:

{{% if event.amount_dollars>500 %}}extremely {{% endif %}}

 

But when I do, I get an error message. How can I create an if statement based on metric event variables?

icon

Best answer by Dov 17 June 2021, 15:58

View original

2 replies

Badge

Thanks so much!!

Userlevel 6
Badge +5

Hello @Lle4,

Thank you for sharing your question with the Klaviyo Community.

Your “if” statement should only have a single bracket around each item and should also include a space between dollars and the figure. So using the example of 100 instead of 500 dollars it should look like the following:

Thanks and have a wonderful day!

Reply