Put this in a Program Rule Action Expression:
d2:condition(‘d2:left(V{orgunit_code},3) == ‘ZA-’’,‘Zambia’,‘Not Zambia’)
The Program Rule itself seems to be working, because the Show error action still fires. the expression itself meant to display after the static text is not functional. Within the console, I find:
angular.js:11655 Expression with id action:NNAPsbz2uzz could not be run. Original condition was: d2:condition(‘d2:left(V{orgunit_code},3) == ‘ZA-’’,‘Kenya’,‘Not Kenya’) - Evaluation ended up as:d2:condition(‘d2:left(‘ZA-Bulaya Village’,3) == ‘ZA-’’,‘Kenya’,‘Not Kenya’) - error message:SyntaxError: missing ) after argument list
Trying to figure out why my formula is mal-formatted; looks like ’ ’ is necessary and noted to be required in dhis-2 documentation; removing the ‘’ for the true and false parameters does not fix the solution. I’m wondering if it might be the () within the d2:left formula which is causing the entire thing to break. This sounds similar to [DHIS2-2813] - Jira, and while it notes being fixed in 2.29, it also notes tracker, so not sure if the fact that I’m in Event Capture (2.31.6) is important.
Thanks for any assistance!