Hi everyone,
I have created a data element counter to count the number of events being filled, but the counter is not showing the expected result.
Steps
- I created a program variable called counter and chose the DE
- I created a program rule with the following expression
d2:hasValue( V{enrollment_date} ) to trigger the rule when the enrollment date is selected. - I created a program rule action to assign value to counter data element
Expression to evaluate and assign: V{event_count}
Problems
- The program rule is not triggered immediately unless I click on the stage.
- The counter begins at 1, which is correct but when I fill the event the second time the counter becomes 2 in both first and second event. (this is confusing for the user because I expected to see 1, 2, 3 … as the user continues entering data for the program stage)
First visit counter = 1
Second visit counter = 2 but when the user clicks back on the first visit the counter shows 2 not 1 as seen below.
Is this the correct behavior when using V(event_count)?
How can I configure the program rule to show correct numbering in ascending order- 1,2,3,4…
Thanks