Skip to main content
Contributor I
June 12, 2024
Solved

Issues utilising "timesince" filter

  • June 12, 2024
  • 3 replies
  • 134 views

I am experimenting using conditional statements in my email. I have a condition if a user has “fashion” as interested category, and am trying to add, or if they have joined in the last 90 days. I have a flow that creates a custom property, and sets it as the day the user joins the list. I am utilising the filter timesince so I can filter out those who are greater than 90 days. 

 

When I try this code, it saves fine, and I can preview for those who don’t have that specific property. However if I preview for someone with the property, I receive 

 

    This topic has been closed for replies.
    Best answer by Taylor Tarpley

    Hi there @benjamin.ngo

     

    I don’t believe it’s possible, however, I will double check with out team and come back with an update if they say otherwise!

     

    -Taylor 

    3 replies

    Partner
    June 12, 2024

    Hello @benjamin.ngo 

    Try this:

    {% assign current_date = "now" | date: "%s" %}

    {% assign target_date = person|lookup:’Created’ | date: "%s" %}

    {% assign ninety_days_ago = current_date | minus: 7776000 %}  

    {% if target_date < ninety_days_ago %}

    <!-- Date is more than 90 days ago -->

    Do something

    {% else %}

    <!-- Date is within the last 90 days --> Do something else

    {% endif %}

    https://theforms.pro
    Contributor I
    June 12, 2024

    Hello @benjamin.ngo 

    Try this:

    {% assign current_date = "now" | date: "%s" %}

    {% assign target_date = person|lookup:’Created’ | date: "%s" %}

    {% assign ninety_days_ago = current_date | minus: 7776000 %}  

    {% if target_date < ninety_days_ago %}

    <!-- Date is more than 90 days ago -->

    Do something

    {% else %}

    <!-- Date is within the last 90 days --> Do something else

    {% endif %}

    Hi @Maxbuzz 

    Whenever I use the assign tag it returns this.

    I assume it isn’t a function supported by Klaviyo

    Taylor Tarpley
    Community Manager
    Community Manager
    June 28, 2024

    Hi there @benjamin.ngo

     

    I don’t believe it’s possible, however, I will double check with out team and come back with an update if they say otherwise!

     

    -Taylor