If a user completes 8 tasks out of 10,
the hidden value switch to "4stars" and the mapping target an icon showing 4 stars
If a user completes 6 tasks out of 10, it should show *** (3 stars) against his/her name.
the hidden value switch to "3stars" and the mapping target an icon showing 3 stars
If a user completes 4 tasks out of 10, it should show ** (2 stars) against his/her name.
the hidden value switch to "2stars" and the mapping target an icon showing 2 stars
The bonus with this method is that you can control the aspect of your stars, and you will have the same stars whichever device is used.
Thanks Michel. Actually i want to make an start rating question and trying to use unicode but in app it is not reflecting. it shows only unicode not star. Do u have any work around. I have used emojis also but it is showing only white star with a small size and i want to use a medium size star with pale yellow colour.
Thanks Clayton for your support on this. I have used "Star" emoji ⭐ White Medium Star Emoji in app but this doesnt give me fruitful result. it shows small and white Start while i am looking for Pale Yellow star with a big size. You can see the image here
How these stars appear is a bit dependent on the phone, as the app just uses the native font rendering.
It might help to go to a page like this: http://xahlee.info/comp/unicode_stars.html on the phone itself and see which of these characters is displayed the most to your liking, and use that for your app.
Thanks a ton Michel for your help. Icons with size 50x50 pixels are working. Now i have another query
Can we show text in colour on the basis of output conditions ? like if a user has not visited to a house for last seven days then his/her name should be shown as RED text
nop. it is not possible to color texts in Commcare. (could be a great feature by the way !)
But you can use another icon if you want ! (red flag, little chrono, etc.) You can add calculation in the mapping as shown in the example in the first link I've shared.
Thanks Michel for your continuous support. While using icons, the title is disturbed. in my case, in case list "Pregnant" title is somehow disturbed while using icons in case list. u can see blow image
Yes, it is not possible to adjust the width of the column when using icons... Usually, there is no titles because the icon is supposed to make sens without it.
If you only present the name and the icon in the case list, a workaround is to include a third column before the icon and leave it empty with just the title Pregnancy.
I have created a hidden value which is storing visit date of a user with formula "today()" .
now i want if the next visit date is after two days then it should show "Green icon" in case list and if user was not visited within that two days or crossed those two days then icon should be turned into red.
For example Now what i have done is that if next visit date is greater than today then it should show RED but it is not reflecting red icon and showing green icon.
Does it improve the funcitoning if you wrap the "." in an explicit date cast, ie: "date(.) > today()"?
I think your math may also be backwards. the call of ". > today()" means that the date of the visit is after today, which would be true for a visit scheduled 2 days from now.
That will be applicable on hv_last_visit_date or do i need to create another hidden value hv_next_visit (Storing next visit date) then apply above formula on hv_next_visit
You have a property in wich you store the last visit date at the end of the form used during this last visit, true ? This property is called hv_last_visit_date.
Then you want to discriminate between beneficiary that
were visited in the last 3 days (green)
weren't visited during those last 3 days (red)
Then, using hv_last_visit_date in the case list, you do the mapping as said :
Green : today() <= date(. + 3)
Red : today() > date(. + 3)
Now, if the next visit date is known, no need for all this : just count the number of days between the last visit and the next visit and check if this number is greater than 3 or not...