How do I display a model's filter name in a template field?

  • 1
  • Question
  • Updated 3 years ago
  • Answered
I'm using some visualizations that change based on a filter in a table. I'd like to display the current filter name in the subtitle of the visualization, e.g. {{Model.labelPlural}} [Opportunities] is my title, I'd like my subtitle to be {{Model.filterName}} [Closing This Month] [Closing Next Month] 

Is there syntax to reference a model's filter names?
Photo of Jack Sanford

Jack Sanford, Champion

  • 8,322 Points 5k badge 2x thumb

Posted 3 years ago

  • 1
Photo of mB Pat Vachon

mB Pat Vachon, Champion

  • 42,714 Points 20k badge 2x thumb
hmmmm ... I'd create a custom field renderer on a field. That way you'd get full control of what is displayed. Then, when rendering the field, you could retrieve the names of the Conditions, format whichever way you'd like and display it. A template field feels like it would require some hackery to make it happen.
Photo of Jack Sanford

Jack Sanford, Champion

  • 8,322 Points 5k badge 2x thumb
Sounds like the way to go. Instead of forcing it into the subtitle field on the visualization, would be nice to just have a big text at the top of my column of donuts that said This Month, or This Year, etc. 

What would be the JavaScript to reference a table filter's label names? 
The rendered html for the item is: <div class="nx-actionselect-dropdown-item">This Month</div>

Here's what my page looks like, I would add the custom component right above the first word Opportunities