Changing color based on score

Dear all,
I have a COVID-19 IPC assessment tool built-in Kobo. It has sections and each section has a score. I want to see a three-color grading for each score. can anyone support me on how to do it in Kobo?
Kind regards,
Derebe

Hi @22Derebe,

Welcome to the community! You could follow the method as outlined in the image below:

In the survey tab of your xlsform:

In the choices tab of your xlsform:
Image 2

Data entry screen as seen in KoBoCollect android app:

Reference xlsform:
Changing colour with the value.xlsx (11.4 KB)

Note: Please be informed that at the moment the colour changing feature is only available with the Collect android app and Enketo does not support the same.

Have a great day!

2 Likes

Thank you very much @Kal_Lam. Apologies for asking questions which may seem silly I am not an IT person. What will you do for medium (yellow color if the condition is, for example,>3 and <=4 instead of =3? I have three conditions where >=7 is red, 8-11 is Yellow and >=12 is green.
Thanks again,
Derebe

Hi
Have you tried coding it as you have indicated? Please note this does not need any complex it skills, it is all about applying the logic using example provided by @Kal_Lam.

Stephane

1 Like

@stephanealoo thank you, would this be if((${Q1} >= 8 AND <=11)?

Hi,
You can then apply that logic using the numbers you need e.g. 3 or 4 as you may wish to have.

Stephane

Hi @22Derebe,

Try using this formula:

if((${Q1} <=7), ‘<span style=”color:red”>Low</span>’, if((${Q1} >= 8 and ${Q1} <= 11), ‘<span style=”color:yellow”>Medium</span>’,if((${Q1} >= 12),’<span style=”color:green”>High</span>’,'')))

Reference xlsform:
Changing colour with the value.xlsx (11.3 KB)

Have a great day!

1 Like

Thank you so much @Kal_Lam.

1 Like