I have a circles module and a cities module (circles > cities). All fields mentioned below are text fields.
I have made a chart on the cities module that uses circle = β${record.values.circle}β as a prefilter.
Problem is that this chart only runs on record pages. On non-record pages it is blank.
I tried another combination:
${record ? βcircle = β${record.values.circle}ββ : βTRUEβ}
This should work, since it works on the chart builder page. Also just setting TRUE in the Prefilter box also works to ignore the filter. However it fails on non-record pages.
Another combination I tried was:
${record ? βcircle = β${record.values.circle}ββ : ββββ}, but that gives an empty node set error.
Another combination I tried was:
circle = β${record ? record.values.circle : ββ}β
but that actually filters circle = ββ on non-record pages, which makes sense, and shows all those records where the circle field is empty. I donβt want that. I want it to show all records on non-record pages.
I did try putting an always TRUE expression after the β:β, but that also does not work. I suspect the issue is that the non-record pages simply ignore the chart if the filter contains record interpolation even if there is a way out in the filter. Also, OR syntax would not work simply because it will return all records in a record page as well. is there a TRY CATCH or CASE like syntax I could use?
Goal: Is there and combination of Prefilter (simplified SQL), where the chart ignores the prefilter and shows all records if the record object is not there (on non-record pages), and uses the prefilter if the record object is there (on record pages)?
Currently I have sidelined the issue but making duplicate charts, one for a non-record page, and one for a record page, but that does increase complexity.