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.

Sentry image

Hands-on debugging session: instrument, monitor, and fix

Join Lazar for a hands-on session where you’ll build it, break it, debug it, and fix it. You’ll set up Sentry, track errors, use Session Replay and Tracing, and leverage some good ol’ AI to find and fix issues fast.

RSVP here →

Top comments (0)

A Workflow Copilot. Tailored to You.

Pieces.app image

Our desktop app, with its intelligent copilot, streamlines coding by generating snippets, extracting code from screenshots, and accelerating problem-solving.

Read the docs

👋 Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay