Visibility Rule


Visibility Rule allows a configurator to programmatically set show/hide and enable/disable options for pages, groups, and fields based on logic.Common reasons to hide or show fields include if that UI is not relevant based on the configuration a user has specified. For example, if you are building a box configurator, and it has fields regarding the type of nails you wish to use to assemble the box, those fields would only be visible if the user selected "wood" as the material to use (as opposed to cardboard or metal).


Arguments

Name Type Description
clientLanguage text the two-character code representing the current user's preferred language.
configurator Configurator the current running configurator.
environment string "dev" if you are in the development environment, "test" if you are in the test environment, and "prod" if you are in the production environment.
isMobile boolean true, if the viewport seems to have the size of a mobile device.  Use this flag to show something differently on screen if required by a smaller device. 
parameters map a map of GET or POST parameters passed into the configurator when it was launched.
user User

Examples


Snap rules run in a specific order, and in response to specific events. Learn more about rule execution order.

Was this article helpful?