---
title: "Filtering GravityExport with conditional logic and relative dates"
date: 2026-04-23
author: "GravityKit"
link: "https://www.gravitykit.com/docs/gravityexport/filtering-gravityexport-with-conditional-logic-and-relative-dates/"
---

When setting up [GravityExport](https://www.gravitykit.com/extensions/gravityexport/) to export entries based on date ranges using conditional logic, you may encounter two issues:

- Conditional logic not filtering entries correctly when added directly to a Save feed
- Relative date formats (like “last day of last year”) not working as expected

This guide explains the workaround to filter entries by date using GravityExport Filter feeds.

## The problem

### Issue 1: Conditional logic in Save feeds

When you add conditional logic directly to a GravityExport Save feed, it may not filter entries correctly. This is a known bug that is being addressed by our development team.

### Issue 2: Relative date format behavior

PHP handles relative dates in unexpected ways. For example, using `last day of last year` as a relative date may not generate the correct date value. Learn more about [PHP’s relative date formats](https://www.php.net/manual/en/datetime.formats.php#datetime.formats.relative).

## The workaround: Using Filter feeds

You can work around both issues by creating a separate GravityExport Filter feed with valid relative date logic, then applying that filter to your Save feed.

### Step 1: Create a Filter feed

- Go to **Forms** > hover over your form and click **Settings**
- Click the **GravityExport** tab
- Click **Add New** under the **Filter Sets** section
- Give your filter a descriptive name (e.g., “Filter Current Year Entries”)
- Set up your date filtering logic: 
    - In **Filter Settings**, click **Add Condition**
    - Select **Entry Date** from the first dropdown
    - Choose **is after** as the operator
    - Enter `first day of this year` as the value

 ![Filter settings with conditional logic: Entry Date after Dec 31 last year and before Jan 1 next year](https://www.gravitykit.com/wp-content/uploads/2025/10/image-2.png)
Screenshot showing the Filter Sets configuration with Entry Date is after “first day of this year”- Click **Update Settings** to save the filter
> **Tip:** Using `first day of this year` is more reliable than `last day of last year` due to how PHP processes relative date formats.

### Step 2: Apply the filter to your Save feed

1. Navigate to your **Save** feed settings
2. In the **Conditional Logic** section, find the **Filter Sets** dropdown
3. Select the Filter feed you just created (e.g., “Filter Current Year Entries”)
    
     ![Filter current year entries using GravityExport's configured settings](https://www.gravitykit.com/wp-content/uploads/2025/10/image-3.png)
*Screenshot showing the Save feed with Filter Sets dropdown selecting “Filter Current Year Entries”*
4. Click **Update Settings** to save your changes

### Step 3: Test the export

Create a new entry in your form to trigger an automatic export (if configured), or manually download the export file to verify that only entries from the current year are included.

## Understanding Entry Date vs. database date format

### What “Entry Date” means

When you select **Entry Date** in GravityExport filter settings, you’re filtering based on the `date_created` column in the Gravity Forms entries database table.

### Date storage format in Gravity Forms

Gravity Forms stores dates in the database in `yyyy-mm-dd` format, regardless of how dates are displayed on the front end. This is important to know if you’re:

- Adding entries programmatically
- Importing entries from external sources
- Troubleshooting date filtering issues

If entries were added outside the standard form submission process using a different date format, this could cause unexpected filtering behavior.

## Alternative date filtering options

### Filtering by a specific date range

To filter entries from a specific date range (e.g., September through December 2024):

- Add a condition: **Entry Date** **is after** `2024-09-01`
- Click **Add Condition** again
- Select **Entry Date** **is before** `2025-01-01`
- Ensure the **Match** setting is set to **All** (so both conditions must be true)

### Filtering using merge tags

You can also use merge tags for dynamic date filtering:

- `{today}` - Current date
- `{tomorrow}` - Tomorrow’s date
- `{yesterday}` - Yesterday’s date

> **Note:** While merge tags like `{today}` work in some contexts, using relative date phrases like “first day of this year” in Filter feeds provides more reliable results for year-based filtering.

## Related documentation

- [GravityExport: Getting Started](https://www.gravitykit.com/docs/gravityexport/getting-started-with-gravityexport/)
- [GravityExport: Filter Settings](https://www.gravitykit.com/docs/gravityexport/creating-filter-sets-in-gravityexport/)
- [Gravity Forms: Date Field](https://docs.gravityforms.com/date/)

## Still having issues?

If you’re still experiencing problems with date filtering in GravityExport, please [contact our support team](https://www.gravitykit.com/support/) and provide:

- The name of the form you’re working with
- Examples of entries that should or should not appear in your export
- Your Filter feed and Save feed configurations (screenshots are helpful)

We may ask you to grant us temporary access to your site so we can investigate the issue directly.