Best answer

Output variable date based on conditional logic

  • 27 January 2022
  • 2 replies
  • 372 views

The goal is to output a date value based on the current date.

IF “current date” < “3/25/22”

THEN output = “3/25/22”

ELSE output = “9/25/22”

I attempted to use a Python code step but I encountered an error. I’m not a coder and didn’t really know what I was doing so I gave up.

Thanks!

icon

Best answer by GetUWired 22 February 2022, 14:59

View original

This post has been closed for comments. Please create a new post if you need help or have a question about this topic.

2 replies

Userlevel 7
Badge +14

Hi @Taxprepper 

Have you tried using Filters?

Date/time conditions

Like the name suggests, date/time conditions work with dates and times Zapier finds in your trigger or action. For example, you could use a filter that will allow your Zap to run if a task due date is between a specific date and time range. Remember: Filter by Zapier allows you to use multiple filter conditions if you'd like. 

You can use the following date/time conditions in a filter:

Field type

Condition

What it means

(Date/time)

After

Checks if a date or time is after a specific date

(Date/time)

Before

Checks if a date or time is before a specific date

(Date/time)

Equals

Checks if two dates match

 

The value you want to filter must be in a date/time format, such as 01/01/2021 or 8:00 p.m. If the value you want to filter is generic, such as Monday or September, use a text condition instead. 

Userlevel 7
Badge +12

@Taxprepper 
This can also be done with a Fomatter > Number > Spreadsheet style formula. 

First go to this site: https://www.epochconverter.com/ to determine the epoch timestamp for the 3/26/2022. I did 3/26 at midnight so we could do < in our compare statement. 

You will copy the Epoch Timestamp. 

Then in Zapier (make sure your timezone is also set in your settings) use the formatter like so 
FORMULA: IF({{zap_meta_timestamp}}< 1648267200,"3/25/22","6/25/22")