Skip to main content
Solved

Variable syntax for number of orders placed

  • January 10, 2024
  • 1 reply
  • 262 views

CKeast
Contributor IV
Forum|alt.badge.img+4

I’d like to use variable syntax in a flow email to communicate how many orders a customer has placed with us during a certain time period. (“Congratulations! You’ve placed X orders with us since DATE.”) I’m having a difficult time figuring out A) if this is possible; and B) which variables to use.

Any ideas? Or if you know of another way to do this other than variable syntax, I’m all ears.

Best answer by In the Inbox

Hi @CKeast 

Thank you for posting your question in the community! 

This is a question that I have seen come up more often recently, but unfortunately, there is not straightforward way to insert the number of orders a customer has placed within the body of the email without creating a custom profile property. 

Once you have the custom profile property created and populated with the value of orders, then you can simply pull that embed that custom profile property into the email.

The challenge is getting that value populated. As of right now (and I’ve had some discussions with Klaviyo’s team about this prior), you could create some flows that update a profile property when an order is placed. You’d have to create multiple flows to update the property based on the number of orders a customer as placed. For example:

Flow 1:

Trigger: Placed Order = 1 over all time - Update Property Step - Set “Number of Orders” to 1

Flow 2:

Trigger: Placed Order = 2 over all time - Update Property Step - Set “Number of Orders” to 2

Flow 3:

Trigger: Placed Order = 3 over all time - Update Property Step - Set “Number of Orders” to 3

Etc.

Then, in your email, you would use the “Number of Orders” property to dynamically show the value that was saved. 

I’ve asked for a way to use their tags to dynamically show orders based on the event data saved to a profile, but this functionality is not yet available.

I hope this helps!

@In the Inbox 

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

1 reply

In the Inbox
Partner - Platinum
Forum|alt.badge.img+31
  • 2025 Champion
  • 292 replies
  • Answer
  • January 10, 2024

Hi @CKeast 

Thank you for posting your question in the community! 

This is a question that I have seen come up more often recently, but unfortunately, there is not straightforward way to insert the number of orders a customer has placed within the body of the email without creating a custom profile property. 

Once you have the custom profile property created and populated with the value of orders, then you can simply pull that embed that custom profile property into the email.

The challenge is getting that value populated. As of right now (and I’ve had some discussions with Klaviyo’s team about this prior), you could create some flows that update a profile property when an order is placed. You’d have to create multiple flows to update the property based on the number of orders a customer as placed. For example:

Flow 1:

Trigger: Placed Order = 1 over all time - Update Property Step - Set “Number of Orders” to 1

Flow 2:

Trigger: Placed Order = 2 over all time - Update Property Step - Set “Number of Orders” to 2

Flow 3:

Trigger: Placed Order = 3 over all time - Update Property Step - Set “Number of Orders” to 3

Etc.

Then, in your email, you would use the “Number of Orders” property to dynamically show the value that was saved. 

I’ve asked for a way to use their tags to dynamically show orders based on the event data saved to a profile, but this functionality is not yet available.

I hope this helps!

@In the Inbox