No Value Behavior

  • 1
  • Question
  • Updated 3 years ago
Working on a report page.
I have a model which collects some Ids based on a date range. The range is set to the last 30 days on pageload. A table component at the top of the page allows the user to set the date range.

I have a model aciton on that DateRange model so that qhen it iw queried, a bunch of other models are queried which reference the Ids of the rows in DateRange.

Now, if the date range is set such that DateRange returns 0 rows, I want the other models to return 0 rows. So I set the no value behavior to noquery.

The problem comes when the date range is changed from something that returns rows to something that doesn't return rows, because then the other models don't query and remain with their previous values (based on the old date range). Is there a way that I can force a query so that the models return nothing? Or just empty the models?

Seems like a no value behavior of 'empty the model' would be nice here.
Photo of Matt Sones

Matt Sones, Champion

  • 31,478 Points 20k badge 2x thumb

Posted 3 years ago

  • 1
Photo of Ben Hubbard

Ben Hubbard, Employee

  • 12,490 Points 10k badge 2x thumb
We've had some internal discussions about this scenario. Adding in a "make condition false" No-Value Behavior is something that has been proposed. One trick you can do right now though is add an additional condition that will always be false. Like Id = <blank value>. Then add in some condition logic like 1 OR 2. Where condition 2 is your "always false" condition. That way, when your main condition is deactivated, your model returns no rows.
Photo of Matt Sones

Matt Sones, Champion

  • 31,478 Points 20k badge 2x thumb
Nice work-around. Thanks, Ben.