Add icons in case lists to alert chws

Hi, everyone.

I have a hidden value that calculates the number of days between visits. This hidden value in the case list details.

I would like to show two icons: a green icon if the number of days is above zero and a red icon if the number of days is below zero as a way to alert the chw to the followup visits. Is there a way of doing this on commcare?

Hi @davuyambantu,

Yup, this is certainly possible, and one of my favorite aspects of CommCare, which allows you create a truly actionable case list.

If you read this page, you will quickly understand exactly how to accomplish this.

Please let me know if you have further questions.

Thanks,
Dev

Hi @Dev
I will have a look at the page and say something after reading it.

Hi, @Dev

I read the page and it was really helpful, but I get an unexpected result in the nested if statement below:
if (next_visit_date < -5, “red”, if(next_visit_date >= -5 and next_visit_date <=5, “yellow”, if(next_visit_date >5, “green”, ''))).

next_visit_date is a hidden value that calculates the number of days between visits. The is problem is that the first two conditions are never met in the expression. I get green as the result even if the number of days are below zero.

Hi @davuyambantu,

Can you provide the link to your app, please. Thank you.

Dev