← Back to team overview

dhis2-devs team mailing list archive

Re: Program Rules are not working on Dropdowns(Event/Tracker )

 

Thanks for the reply markus,

I have tried using true/false also but did not get the result and for
option sets I am using single quotes for the Codes.  Can you make a simple
rule on demo instance for any dropdown.

Thanks again.


On Fri, Nov 27, 2015 at 4:55 PM, <markus.bekken@xxxxxxxxx> wrote:

> Hi Shourab!
>
> Is your dropdown defined using a 'yes/no' data type, or in fact an option
> set?
>
> For yes/no data types, the syntax would be:
>
> #{bcg} == false || #{bcg} == true
>
> Or shorthand:
>
> !#{bcg} || #{bcg}
>
>
> If it is an option set, the rule seems correct(but did you mean to hide
> the fields both when the dropdown is 'yes' and 'no'? In that case the
> dropdown also specifies other options than yes and no, your rule makes
> sense.
>
> Markus
>
> Den 27. nov. 2015 kl. 12.17 skrev Sourabh Bhardwaj <bsourabh191@xxxxxxxxx
> >:
>
> Hi,
>
> Can anybody tell how to create program rules for dropdowns. As i am doing
> it in following way:
>
> If
>
> #{bcg} == 'No' || #{bcg} == 'Yes'  then Hide some field.
>
> No/Yes are values from dropdown.
>
> I am using https://play.dhis2.org/demo link.
> [image: Inline image 1]
>
> But this expression is not working. I have tried on other dropdowns also
> but doesn't get the output.
>
> Thanks & Regrads,
> Sourabh Bhardwaj.
>
>
>
> _______________________________________________
> Mailing list: https://launchpad.net/~dhis2-devs
> Post to     : dhis2-devs@xxxxxxxxxxxxxxxxxxx
> Unsubscribe : https://launchpad.net/~dhis2-devs
> More help   : https://help.launchpad.net/ListHelp
>
>

PNG image


References