ValidatePattern NOT working

Good day,

Kindly assist in reviewing my expression.
I’m using the web version 2.37.7 to create a PR that assigns an “Option” to a DE once a match is found.

Scenario: I have two DEs; Product and Category.
If the keyword “Sponge” (case insensitive) is found ANYWHERE in a sentence in Product, then it should assign the OptionKitchen Supply” to Category.
NB: Category is a drop-down list. I’ve also tested the Regex.

PR Expression
d2:validatePattern( #{product}, /.i(Sponge).*/gi)

PR Action
Action: Assign Value
DE to assign to: Category
Expression to Evaluate: ‘Kitchen Supply’

Kindly assist

@YuryR @Gassim
@Markus
@tracker-programRules

1 Like

Hi @Don_Vieira,

This seems smooth and carefully configured. Did you choose a ‘trigger by program stage’ or assign a priority?

Please make sure you clear the cache after the configuration. (to be 100% sure it’s not a cache issue try a new/different browser/profile where you’ve not visited dhis2. I always use ‘Guest’ mode on Chrome to check)

If it’s not a cache issue, please see if performing maintenance will help:
40%

Most importantly if all that is not working do you see any errors in the console/network tab when that’s supposed to happen?

Thanks!

Thanks @Gassim , I will try allocating priority. The other options are ruled out since i tried them earlier.

Thanks again

1 Like