Filtering GravityExport with conditional logic and relative dates

When setting up GravityExport to export entries based on date ranges using conditional logic, you may encounter two issues:

  1. Conditional logic not filtering entries correctly when added directly to a Save feed
  2. 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.

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

  1. Go to Forms > hover over your form and click Settings
  2. Click the GravityExport tab
  3. Click Add New under the Filter Sets section
  4. Give your filter a descriptive name (e.g., “Filter Current Year Entries”)
  5. 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
    Screenshot showing the Filter Sets configuration with Entry Date is after “first day of this year”
  6. 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
    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):

  1. Add a condition: Entry Date is after 2024-09-01
  2. Click Add Condition again
  3. Select Entry Date is before 2025-01-01
  4. 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

Still having issues?

If you’re still experiencing problems with date filtering in GravityExport, please contact our support team 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.

Did this answer your question? Thanks for the feedback There was a problem submitting your feedback. Please try again later.

Still need help? Contact Us Contact Us