1. Support arrow-right
  2. Understanding Date Filters in Connection Paths

Understanding Date Filters in Connection Paths

When defining the connection path for a Data Push or Data Pull connection, you can enter various filters, including dates, to dynamically restrict which records ItemPath selects. Date filters often use operators like gt (Greater Than) and lt (Less Than) alongside a time variable, such as {last1day:%Y-%m-%d}. You can use the dynamic date variable buttons to select the right date/time format, but you will need to type the remaining filter details in manually.

Since we are dealing with dates, rather than simple numbers, understanding how "greater than" and "less than" apply to time is crucial for syncing the correct data.

The Golden Rule of Date Filters

Think of time as a left-to-right timeline.

  • gt (Greater Than) means dates that are ahead on the timeline (closer to the present/future, or "newer").
  • lt (Less Than) means dates that are behind on the timeline (further in the past, or "older").

Examples in Action

ItemPath resolves the date value, then the source API evaluates the comparison. For the following examples, let's use the variable {last1day:%Y-%m-%d} (which means "today minus 1 day") and imagine today is October 15th, meaning the variable resolves to October 14th

1. Greater Than (gt) = Moving Forward / Newer

Example Path Filter: LastChangeDate gt {last1day:%Y-%m-%d}

  • How ItemPath reads it: "Find records where the LastChangeDate is greater than October 14th".
  • What it selects: Any records modified after October 14th (e.g., October 15th, October 16th, etc.).
  • Common Use Case: This is the standard setup for capturing new or recently updated data, ensuring you only pull or push records that have changed within the specified window.

2. Less Than (lt) = Moving Backward / Older

Example Path Filter: LastChangeDate lt {last1day:%Y-%m-%d}

  • How ItemPath reads it: "Find records where the LastChangeDate is less than October 14th."
  • What it selects: Any historical records modified before October 14th (e.g., October 13th, October 12th, etc.).
  • Common Use Case: This is typically used for archival purposes, data purging, or syncing a specific historical backlog of older data.