Program rule not working correctly on Android - Tracker Capture


I have setup a program rule to show error when a value is less than a previously entered value:
i.e. #{nlc_pop_at_risk_REPORT} < #{nlc_cases_REPORT}
This works perfectly on the web but not on Android. It only works well when the values are less than 100. For example, it is evaluating 101 to be less than 88, but correctly evaluating 99 to be greater than 88.


Hello @minyoi. Could you please share the metadata of the program you are using or access to a testing server where we could check this? Or recreate the program in any of the play servers?

Hi @minyoi, the issue that you are experiencing was fixed in [DHIS2-13821] - Jira. Let us know which version of the software you are using, maybe an upgrade will solve the problem

1 Like

Thanks @jaime.bosque …
Hi @enrico, i am currently using dhis2 version 2.36.6 and android capture version 2.7.1. I recently upgraded the android capture version

Hey @minyoi !
What is the data type for the data elements behind the variables you used in the expression:




For some reason it sounds like Android rule engine treats the values as text, and the web rule engine treats the same values as numeric - so to try to reproduce it might be relevant which data types is used.


1 Like

Hi @Markus ,
They are both Positive or Zero Integer

1 Like

This is a continuous issue on all Android versions after 2.5.2. The fix that was presented to me was to turn the text into a number by adding a subtracting a number to it in the program rule. This doesn’t work for us simply because of not wanting to add the complexity to so many program rules that we have in our system, but perhaps it can work for you @minyoi !

@enrico this was indeed fixed in capture app, as noted [DHIS2-13821] - Jira but was never fixed in android.

cc @Markus


Yes indeed @Matthew_Boddie … The fix works perfectly and is certainly good enough for our setup. Thanks, much appreciated.


Great @minyoi ! Glad that worked for you.

@jaime.bosque @Markus I couldn’t actually find a Jira Ticket on this issue for Android Software, which surprised me. This is a quite significant road block for us–just checking that this is clear? Happy to create a ticket or whatever is needed if useful.

cc @Gassim

1 Like

Hello, @Matthew_Boddie . We are investigating the issue and we will let you know. You can always create the JIRA if you want and we will update it there (as well as here to link it) or , otherwise, we will create ourselves :slight_smile:


Thanks @jaime.bosque ! I posted a quick version here: