PostHog / PostHog/posthog

Allow accessing nested JSON properties in UI filters

Open
#72,155 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement
Dominant language
Python
Stars
39.9k
Forks
3.4k
Avg merge
6h 51m
Merged PRs (30d)
232

Description

Feature request

Is your feature request related to a problem?

The UI property filter picker doesn't natively support drilling into nested JSON objects. It only surfaces top-level properties.

Specifically, I'm trying to create a dynamic cohort based on a nested JSON attribute in a person property (e.g., profile.user_type) , but I can only select the top-level property (profile). The UI cohort config does not have a SQL expression option.

Describe the solution you'd like

  1. Selecting a property that is a JSON object should then surface its attributes as filterable properties
    or
  2. Make sure SQL is an option everywhere properties can be selected as filters/criteria

Describe alternatives you've considered

Flattening all JSON objects

Additional context

Debug info
Session: https://us.posthog.com/project/sTMFPsFhdP1Ssg/replay/019f75e6-9eb6-7dbb-9b27-19cf0a0f2b4f?t=2780
Admin (internal): http://go/adminOrgUS/01962554-e342-0000-4942-7fa64a8d395f (project ID 483452)

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start from the UI property filter picker and cohort configuration described in the issue, tracing how top-level JSON properties become selectable filters. Compare the two proposed approaches—surfacing nested attributes or enabling SQL criteria—and define completion as supporting nested JSON filtering in the relevant UI flow.

Written by the indexing model from the issue text.

Assessment

Domain
analytics, frontend
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.