Filtering out a module if there are no cases

Hi All,

I have a module with no forms - just a case list of products that is
filtered for only those products that are low on stock. I would like this
module to NOT appear if the case list is empty - that is if there’s no
product low on stock I don’t even want to see the module in the main menu.
The idea here being that if there is something the person needs to order,
when they open up the app they’ll see the “Time to order” Module with a
bright red exclamation point icon.

The conditional for the case list filter (which works perfectly) is:

     stock_on_hand<=standard_order_level

Any ideas on what the xpath expression would need to look like so that the
module would only appear if at least one case in the module had that
condition as true?

And more generally is there a good tutorial somewhere for the xPath
structure of a commcare app that is good for an intermediate (I’m being
generous with myself) level app developer?

Thanks,
Matt

Hi Matt!

You can indeed apply a filter to the module that will accomplish this. I’ll
send you a message offline to follow up.

-Clayton

··· On Thu, Jan 12, 2017 at 1:40 PM, Matt McLaughlin < matt.na.mclaughlin@gmail.com> wrote:

Hi All,

I have a module with no forms - just a case list of products that is
filtered for only those products that are low on stock. I would like this
module to NOT appear if the case list is empty - that is if there’s no
product low on stock I don’t even want to see the module in the main menu.
The idea here being that if there is something the person needs to order,
when they open up the app they’ll see the “Time to order” Module with a
bright red exclamation point icon.

The conditional for the case list filter (which works perfectly) is:

     stock_on_hand<=standard_order_level

Any ideas on what the xpath expression would need to look like so that the
module would only appear if at least one case in the module had that
condition as true?

And more generally is there a good tutorial somewhere for the xPath
structure of a commcare app that is good for an intermediate (I’m being
generous with myself) level app developer?

Thanks,
Matt


You received this message because you are subscribed to the Google Groups
"commcare-users" group.
To unsubscribe from this group and stop receiving emails from it, send an
email to commcare-users+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.