Hide panel based in drop down conditions


Badge +6

Good Day all.

Once again I need your help, I am trying to hide a panel by using some rules based in drop down conditions.

I have a 2 dropdowns the first one called RequestType with the following elemets (Activity, Accounting Unit and Allocations) My second dropdown is Action needed his behavior depends of the first dropdown as below:

RequestTypeRequestTypeRequestType
ActivityAccounting UnitAllocations
Action neededAction neededAction needed
AddAdd New UnitAdd

Extend date                 Change                   Update

Now what I need is evaluate both dropdown elements and :

if  RequestType =Activity and Action needed =Add then show up panel otherwise keep hide.

if RequestType= Accounting and Action needed =Add New Unit then show up Panel otherwise keep hide

and so on.

I have added one rule and it is working but I dont know how put 2 or 3 rules together in this format. 

not(equals(parseLookup(REQUESTTYPE),"Accounting Unit")), not(equals(parseLookup(ACTIONNEEDED),"Add New Unit"))

Thanks


5 replies

Userlevel 5
Badge +14

imho, for a complex formula it's better to build it from beginning in context of to HIDE something and not to show and finally negate result. this may lead to a trap when you will need to extend it further and so make it even more complex.

I would see it as follows

or(   
    or(  
        and(
            equals(parseLookup(REQUESTTYPE),"Activity"),
            equals(parseLookup(ACTIONNEEDED),"Extend date")
           ),
        and(
            equals(parseLookup(REQUESTTYPE),"Accounting Unit"),
            equals(parseLookup(ACTIONNEEDED),"Change")
           )
      ),
   and(
        equals(parseLookup(REQUESTTYPE),"Allocations"),
        equals(parseLookup(ACTIONNEEDED),"???")
      )
)
Badge +6

Hi

This solutions works perfectly, I will fix my issue by using this coding. however I was thinking what if we have like dropdowns with a bunch of escenarios 20 options and just need affect 3 of them??

Userlevel 5
Badge +14

I'm not sure what you mean with the question...

17 of them should hide and 3 of them keep showed?

in general, you can rewrite any logical expression to its negative equivalent. that's simple boolean algebra.

just, some expresions are shorter, faster to understand, easier to maintain, etc. then the others.

just like:  1 == not(0)

Badge +6

Thank you ‌, you are awesome happy.png

Userlevel 5
Badge +14

as always  wink.png

Reply