Skip to content

Filter LOV’s Conditionally

With the introduction of conditional field concept, now, List of Values (LOV) can be conditionally filtered. An administrator can set any number of conditions with their corresponding filter to any given LOV except for dynamically generated content. The framework will evaluate conditions in the order specified and when a condition that evaluates to true is found, it will stop the evaluation and use the corresponding filter to filter the list of values and show them to the end user.

Condition can be either true, false or specified using condition input syntax while the filter should be specified using OData filter syntax without adding the $filter= part at the beginning.

Adding a filter to a simple LOV

First, Page designer should be opened and the field with the LOV should be located inside the page designer tree. Then Filter option should be located in the LOV optional attributes. Example is shown below.

Once the user click the plus (+) button to add a filter, following dialog will pop up asking the user to provide conditional filter. This way, an administrator can provide any number of filters as desired.

Properties of the above dialog can be filled using below guidelines:

Property Description
Case Boolean true/false or a condition . Administrator switch between the two input types using the toggle in the field.
Enabled Check box can be used to enable or disable the condition filter pair if needed.
Value Accepts an OData filter syntax that will be used to filter the LOV values.

After specifying several filters, later, administrator can open up individual conditional filters (case) and do changes as needed.

Adding filters to LOV's with switch case syntax

When it comes to LOVs with switch case syntax, conditional filtering can be specified for individual LOVs in each case. LOV switch case will work as usual and if the selected LOV have conditional filters, they will be evaluated and used to filter the LOV result