issue here. I’m attempting to restrict the number to precisely 11 digits function (d2:validatePattern(A{phoneNumber},‘[0-9]{11}’)). However, the system isn’t responding to this function. Is there a solution to this problem within dhis2 version 2.40?

Hi @Sabri

Welcome back to the community!

I’m not able to reproduce this issue, here’s a screenshot:

Thank you for your response, but it wasn’t clear to me. I’ll formulate it based on the attached image is show is correct

Determine the functionality of the program rule and verify if the equation responds correctly. The system will indicate an error if the phone number is incorrectly entered attached image

However but upon inspection, an error is revealed attached image

1 Like

@Sabri if the programRule variable defined as TEA element it must be used as A{variable_name}, in your case, as I can see, you are using dataElement therefore it should be used as #{variable_name}

Or most possibly you have defined your variables as DE element but used differently.

1 Like