Javascript to Hide and Display a view based on field condition


I have a company table with more details linked to it. In more details view there are few tables.

I have only one company (say Company X) that requires different tables than rest. So my approach is to make all possible tables (views) and then use Javascript to create display rules. But unfortunately i am really bad in Javascript. Can any one help. I want to put conditions like this:

If company field = "Company X" then "Hide View 1" and "Show view 2 and view 3"

If Company field = "Not company X" then "Hide View 2 and view 3" and "show view 1"

In above case View 1 has table for all companies except company X and View 2 &3 are for Company X.

Thank you I will really appreciate your help.


I don't think you can use Display Rules in Tables view. You can only use them in form view where you can hide certain fields based on a criteria.

The views I want to hide and display are Tables.

And I want to show and hide the entire table. Not just one field in a particular table.

Thanks anyway.

Hi Ajay, I believe you can achieve this in the Builder with "Display Rules"?