Segment Queries are Ignored

Feature(s) impacted

Segments Queries

Observed behavior

When I use the “Query” option on the Segment Settings page (to use my own SQL Query), my query is ignored and there are no filters applied to the segment.

For example, I created a very simple segment query for our screen_sequence table (see the image below), the segment has the same results as the un-filtered view.

Expected behavior

I would expect the results of the SQL query to determine which rows are shown in the resulting segment. In the example above, I would only expect to see one resulting row (the row with id=1).

If this feature is no longer supported, then I would expect the documentation to be updated to reflect that. I have been referring to this Forest Admin documentation to set my own expectations thus far:

Failure Logs

I am not getting any errors at all.

Context

  • Project name: GumboUI
  • Team name: DepMap
  • Environment name: Production
  • Agent type & version: django-forestadmin (v1.3.5)

Hello @Sarah_Wessel :wave:

The feature is still live and valid. It works well on my end so let’s debug it.:man_detective:

Can you share the error message you are receiving in either the Console or Network tab of your browser? :mag:
:eyes: From what I can see in your screenshot, the issue might come from the collection name you are selecting from: I believe it should be screen_sequences (or whatever name is defined in the General tab of your collection) instead of screen_sequence

Hi @Romain_Coudour thank you for taking a look at it! I tried the following as table names without any success:

  • screen_sequence (the actual database table name, and the name shown in the general tab, see screenshot below)
  • screen_sequences
  • "Screen Sequence" (the display name)
  • "Screen Sequences" (the plural display name)

Unfortunately, I’m not getting any error messages at the moment, which is why this has been so difficult to debug. It simply shows all of the rows in my segment and ignores my query.

Hi @Sarah_Wessel,

Thank’s for the report.
I check the code base and I don’t find anything about the segment custom query.
However It works fine for the query built in the UI.

I’m working on the fix to enable the custom queries for the segments.

1 Like