Program rules not working

I’ve set up a program rule with two actions, one for testing purposes which displays a string in the Program indicator widget, and the second is supposed to populate a field, both have the same expression and display, when the field that fires the rule is a text field, it concatenates and works ok, but only for the indicator widget, nothing is populated in the intended field, if its a dropdown field, when I change the field and select the dropdown values, nothing is displayed for both the indicator widget and the field, when I clear the dropdown field, only the indicator widget displays correctly (Blaah : 0), and the action field still stays empty. I get the below warning and error from the console:

Expression with id action:jUzwk3DNDMF could not be run. Original condition was: d2:concatenate( 'Blaah : ', #{Field_A1}) - Evaluation ended up as:d2:concatenate( 'Blaah : ', NaN) - error message:ReferenceError: concatenate is not defined

angular.js:11655 TypeError: Cannot read property ‘dataElement’ of undefined
at dataentry-controller.js:473
at Object.r [as forEach] (angular.js:331)
at processRuleEffect (dataentry-controller.js:383)
at dataentry-controller.js:234
at n.$broadcast (angular.js:14785)
at dhis2.angular.services.js:3556
at angular.js:13248
at n.$eval (angular.js:14466)
at n.$digest (angular.js:14282)
at n.$apply (angular.js:14571)

1 Like

Hi @drlappies,

Thank you for reporting your issue.
What version of DHIS2 are you on?

Can someone from @dhis2-tracker have a look?

Best regards,
Karoline

Hi @drlappies,

could you, please, specify what the rule is supposed to do?
Do I understand correctly that you are trying to assign a concatenated value to a Data element?
What kind of a data element is it?

Best regards,

Yury

1 Like

Hi @YuryR, apologies for my late response. We managed to resolve this by clearing out data and cache, still cant pinpoint what was wrong however, I believe there were some javascript errors after some massive changes to Data Element names and structure.

1 Like