The Conditional Visibility section in widget properties allows you to show a widget only when certain conditions are met. You can make widgets visible based on the following conditions:
For example, you have a web shop and you do not want to bother users with filling in the same address twice when the delivery address matches the billing address. You would like to show fields to fill the billing address in only when a user unchecks the Billing address is the same as delivery address option (which is checked by default). In this case you can make the billing address fields visible based on an attribute value: the field will be displayed only when the BillingAddressSame is unticked (set to false):
You can also show a widget to a certain user role only. For example, you can show a widget showing salary amounts only to Finance Managers.
To see which widgets that have conditional visibility configured, click the eye icon is the Show option in the top-left corner of a page:
2 Conditional Visibility Properties
2.1 Visible Based on Data
Visible Based on Data allows you to show widgets based on the outcome of the dynamic data. For example, you would like to show a special offer price only for customers with the Gold grade:
2.2 Condition Based on
The Condition Based on property is only shown when Visible Based on Data is enabled. The following options are available:
- Attribute – Defines whether the condition is based on the attribute value. In this case the widget will be shown only when it matches a certain value of the selected attribute.
- Expression – Defines whether the condition is based on the expression. In this case the widget will be shown only when the expression returns the Boolean value
true. For more information on expressions, see Expressions.
This property is shown only when the expression the Condition Based on is set to Attribute. Allows you to select the attribute the condition will be based on. The attribute must be of the Boolean or enumeration type.
2.4 Attribute Values
This property is shown only when the attribute is selected for the Attribute property. The Attribute Values property allows you to select certain attribute values.
If you would like to show a special offer price only for customers with the Gold grade, you need to select Grade in the Attribute property and Gold in as the Attribute Value:
This property allows you to create an expression and is shown only when the expression the Condition is Based on is set to Expression. The expression should be of the Boolean type. For more information on how to create expressions, see Expressions.
2.7 Visible Based on Role
The widget can be made visible to users with a specific user role only. For example, in a taxi booking app, you would like to show a taxi driver rating to customers and administrators, but hide it from taxi drivers:
You can only configure role-based conditional visibility when security is enabled. For more information, see Security, Roles & Permissions.
The Roles property is only shown when the Visible Based on Role property is enabled and shows a list of roles available in your app.
3 Performing Basic Functions
3.1 Configuring Visibility Based on Attribute Value
To configure visibility based on the attribute value, follow the steps below:
Select a widget you would like to make visible only for certain attribute values and go to its properties.
In Conditional Visibility section, toggle the Visible Based on Data property.
The Condition Based on is set to Attribute by default. Click the Attribute property:
In the Select Attribute dialog box, select an attribute of the Boolean or enumeration type and click Select.
The Attribute Values property is now displayed in properties. Untick the values that do not meet the conditions you would like to set:
Conditional visibility based on the attribute value is set for the widget.
3.2 Configuring Conditional Visibility Based on a Role
To configure role-based conditional visibility, do the following:
Select a widget you would like to make visible only for certain user roles and go to its properties.
In Conditional Visibility section, toggle the Visible Based on Role property.
A list of roles available in your app is displayed in the Roles property. Untick the roles who would like to hide the widget from:
Conditional visibility based on user roles is set for the widget.