Help: Correct Program rule behaviour

Hi community,


Use case
In my tracker I have five program stages ordered in this way (SP, AR. UP, DSD, Reintegration)

  1. For SP program stage. If no value has been selected or the answer to DE Dot_C is no, then hide program stage DSD. The following program rule works properly.
    Program rule expression
    !d2:hasValue( #{Dot_C} ) || #{ Dot_C } == false
    Program rule action: Hide program DSD

  2. If no value has been selected or the answer is no to either Ar - referred to reintegration or Lp - referred to reintegration, then hide reintegration program stage.
    The following program rule works
    (!d2:hasValue( #{Ar - referred to reintegration } ) || #{Ar - referred to reintegration == false) || ( !d2:hasValue( #{ Lp - referred to reintegration } ) || #{Lp - referred to reintegration} == false)
    Program rule action: Hide program stage reintegration.

I am facing the following program:
When PR 1 is triggered, it hides DSD program stage, but it shows reintegration program stage. From the image, SP program stage must open DSD only - if the condition is met, not reintegration program stage.
How can I reformulate the program rule in use case 1 to achieve what is shown in the diagram?


Hi @dmbantu,

When you are using d2:hasValue try to use variables in following way:
For example :
d2:hasValue(‘Ar - referred to reintegration’ ).
Good luck

Hi @Ulanbek,

I think I did what you suggest or no? I mean using d2:hasValue(‘varname’).


And what is the result? Have you got desired behaviour?

Hi @Ulanbek,

I haven’t got the desired result yet. I am stuck.


Could you just put all rule condition expressions here?
And also, after updating PRs you should clear the cache.
Additionally, you can open browser’s console and add & verbose into your address line. And filter all rules by their uid in the same console.

Hi @Ulanbek,

My problem is with the following rule expression. it works but what I want is that when the answer is yes it shows DSD and not Reintegration program stage. Now it shows both.

!d2:hasValue( #{Dot_C} ) || #{ Dot_C } == false


Question : is Dot_C element True only or Yes-No element?
And additionally you should create 2 rules for Yes_No element:

  1. When you want to show DSD
    d2:hasValue(‘Dot_C’ ) && #{ Dot_C } == true
    Action: hide other section
  2. When you want to hide DSD
    d2:hasValue(‘Dot_C’ ) &&#{ Dot_C } == false
    Action hide DSD

And hide both if you have no value
3. !d2:hasValue( ‘Dot_C’ )
Action hide both