Skip to main content

Does anyone have any rules logic that for show/hiding a field based on two different columns?  The scenario I am trying to accomplish is in my form I have a field called Category.  If the user selects "Capital" from that dropdown it will display another field in the form called "Capital Type" using the rule Category !="Capital" which works.  

However, I also have a requirement that on another column named "SubCategory" that includes 3 choices and if one of those are selected then I'll need to display the "Capital Type" field as well. 

Does anyone have any suggestions for logic to have the "Capital Type" field displayed based on rules from two columns?  If I append my current formula rule to include checking against the second column the rule stops working. 

Does NOT work Category != "Capital" || SubCategory !="Capital IT Project" 

rule action (hide) is taken when your formula evaluates to true.

if I understood your requirement correctly, you want to show capital type if category == 'Capital' OR SubCategory == 'Capital IT Project'

so to turn it to hide rule it should look like category != 'Capital' AND SubCategory != 'Capital IT Project', isn't it?


Hi Sherry,

Marian is right. If you switch your Formula to Category != "Capital" && SubCategory != "Capital IT Project" it will work.

In your formula the field will still be hidden even if SubCategory contains the value you need because Category is still not Capital and thus the first part of your Formula will hide the control.

Kind regards,

Enrico


 Hi Marian and Enrico,

 Thanks for responding to my post so quickly.  How do I get the field to show if Category is not capital, but the SubCategory choice is "Capital IT Project?" 

Thanks,
Sherry 


not(Category != "Capital" && SubCategory == "Capital IT Project?")


Thank you Marian.  I used this without the not logic and it worked.  The only issue I am running into now, is when I add the SubCategory statement, it's not recognizing one of the choices in the category field.  

In the category field, I have the following choices: capital, commercial, IT, TT, and Site.  The rules are only to run if the user selects "Capital" or if they select "IT, TT or Site."  Selecting IT, TT or Site gives them the "SubCategory" field.

Selecting "Commercial" should not display any of the other fields, but when that choice is selected, the rules that I applied stop working.  Any ideas? 


if it is not running just for one of the options I would double check you compare correct strings - maybe there is some extra space somewhere or a typo.


Thanks, I'll check that out.


Hi Marian,

Here is the working logic that I used and it works! 

Category!="Capital" &&PRFSubCategory!="Capital IT Project" &&PRFSubCategory!="Capital Tech Transfer Project" &&PRFSubCategory!="Capital Site Project"

Thanks for all your help.

Sherry 


glad you got it working.

however, keep in mind that with every new subcatagory or subcatagory name change your formula will stop working and needs to be updated.


Thanks for the heads up.  I hope that the stakeholder will not have any more changes, but I plan to document this before turning it over.


Reply