V{enrollment_status} == ‘COMPLETED’ - Program Rule expression not supported in Web Tracker (error)

Hello.

I have two errors on my console from the program rule below:


This rule works on mobile and hides the program stage when the TEI is completed, shows when it’s not (expected behavior). But when I check the console on Web Capture, it gives me the following errors:

I’ve tried changing “COMPLETED” to ‘COMPLETED’ but I get the same error. Does anyone have any solution to this issue?

Thanks in advance!

Hey @Pablo. So your solution definitely works on Mobile but I’m getting these errors when I check the console on Web:

angular.js:11655 Expression V{enrollment_status} == ‘COMPLETED’ contains variable enrollment_status - but this variable is not defined.

Expression with id rule:nq6vTMd6H88 could not be run. Original condition was: V{enrollment_status} == ‘COMPLETED’ - Evaluation ended up as:V{enrollment_status} == ‘COMPLETED’ - error message:SyntaxError: Unexpected token ‘{’

Do you know why I would get these errors? Please screenshots of my program rule attached.


Thanks!!

1 Like

Thanks Clara! The expression V{enrollment_status} is only supported in android as you’ve seen but it’s not supported on the Web. See the supported expressions for program rules here: https://docs.dhis2.org/en/use/user-guides/dhis-core-version-237/configuring-the-system/programs.html#program_rules_operators_functions

Thanks!

@Clara please would you like to create a feature request to support the expression V{enrollment_status} in web. I will make sure to triage it! jira.dhis2.org :+1::+1:

Thank you @Clara for the feature request! https://jira.dhis2.org/browse/DHIS2-13137 was sent to the developers the same day you posted. You’ll also be tagged in the copmonthly as a feature finder. :relaxed::+1::+1:

You’ll receive notifications as soon as any developer makes changes and updates to the issue.