DEV Community

Jordan Haines
Jordan Haines

Posted on

How to filter on number or date custom fields in ActionNetwork targeting

This week I learned how to filter (using less than/great than) on a number custom field in ActionNetwork targeting. Because we focus on young progressives at Run for Something, you can imagine we target folks based on their age, when available.

The ActionNetwork docs allude to using << and >> to filter on custom number/date fields but this was not working for our age custom field. The issue was that - in addition to ages - this field contained data like the string "n/a" and "prefer not to answer" (largely from old data sources that were not validated). So, to filter on a number or date field in ActionNetwork, as their docs suggest, you must ensure the custom field has a consistent data type and that there aren't strings mixed in with date or number values (null values are fine).

ActionNetwork Custom Field Filtering

One way to ensure this is the case is to add some field validation. This is the closest analog to designating a field type that ActionNetwork has.

Image of Timescale

🚀 pgai Vectorizer: SQLAlchemy and LiteLLM Make Vector Search Simple

We built pgai Vectorizer to simplify embedding management for AI applications—without needing a separate database or complex infrastructure. Since launch, developers have created over 3,000 vectorizers on Timescale Cloud, with many more self-hosted.

Read more

Top comments (0)

Billboard image

The Next Generation Developer Platform

Coherence is the first Platform-as-a-Service you can control. Unlike "black-box" platforms that are opinionated about the infra you can deploy, Coherence is powered by CNC, the open-source IaC framework, which offers limitless customization.

Learn more