Issue with hide field program rules in Android (2.35, 2.3)

Hi,

I’m aware that some program rules needed to be updated with the new version of the Android app, but there is one program rule in particular that is eluding me:

A{Personal detail consent} == false &&
((V{enrollment_date} > ‘2020-11-29’ && V{event_date} == ‘’) || (V{event_date} != ‘’ && V{event_date} > ‘2020-11-29’))

Action: Hide personal detail TEAs (name, email, address, etc…) unless personal detail consent has been given (Yes has been selected), and the enrollment date is after 2020-11-29.

This works fine on the desktop. I’ve also already updated it according to the guidance (the first part used to read A{Personal detail consent} != 1). However, it is still not working on the android app - the person detail fields are still showing regardless of whether personal detail consent is blank, Yes, or No. Am I missing something, perhaps in the second half of the PR, that needs updating?

Thanks in advance for any tips!

Monika

Hello @monika.

I am linking here @Pablo as the PR expert on our side to see if he sees something, it looks ok to me. Anyway, any chance you can provide an access to the server via private message so I can login and test directly?

Thanks

1 Like

would a d2:hasValue() not be preferable over V{event_date}==‘’ and V{event_date}!=‘’? @jaime.bosque saying it looks right should hold more weight than my inquiry, to be clear–just the first thing that I see when I look at it.

Hi @monika ,

I just found the problem. As I understood, this program rules is triggered in the enrollment form. In that case, the environment variable V{event_date} is always null. The rule engine shared by android and backend is crashing becouse of it.
If this expression has to run on both enrollment and stages I would have two different rules:

A{Personal detail consent} == false && V{enrollment_date} > ‘2020-11-29’

For the enrollment and

A{Personal detail consent} == false && V{event_date} != ‘’ && V{event_date} > ‘2020-11-29’

For stages.

Nevertheless, the rule engine can be fixed to accept your expression, but in the meantime you should be fine with those expressions.

4 Likes

Hi @Pablo,

That did the trick! Everything works beautifully now, thank you so much for the fix, much appreciated :slight_smile:

1 Like