About this article
A filter can be used to show a specific value in a dropdown or combobox form field, depending on the selected value in another dropdown or combobox to narrow don the results displayed to the end-users. It's also possible to filter on multiple dropdowns or comboboxes.
Prerequisites
|
How to filter form fields?
- Go to the Dynamics Designer.
- Click the
Form
tab. - Click
Add form field
. - Select
DropDown
orComboBox
. - Fill out the required information.
- Click
Filter options
. - Click
Add filter
. - Select a filter from the dropdown.
Optionally, repeat steps 7 and 8 to add additional filters to the form field. - Click
Save
.
|
Examples
In the examples below these data sources are used. The data source MobilePhoneManufacturers:
The data source MobilePhoneModels (the image only shows a part of the data source).
The column Manufacturer is a reference to the column Name of the MobilePhoneManufacturers data source:
The data source MobilePhoneStorageCapacity (the image only shows a part of the data source).
The column Model is a reference to the column Name of the MobilePhoneModels data source:
The data source MobilePhoneColors:
The data source MobilePhones (the image only shows a part of the data source).
The columns Manufacturer, Model, StorageCapacity and Color are a reference to the column Name of the data sources above:
|
Example 1
Use Filter by option with one filter to show phone models in the 'Models' dropdown, depending on the selected manufacturer in the 'Manufacturer' dropdown.
- Create a dropdown form field named 'Manufacturer' and link it to the 'Name' column of the 'MobilePhoneManufacturers' data source.
- Create a dropdown form field named 'Model' and link it to the 'Name' column of the 'MobilePhoneModels' data source.
- Expand Filter options then click
Add filter
. In the Filter by field select 'Manufacturer'. The result looks like this:
- Now when a user selects 'BCompany' in the 'Manufacturer' dropdown, the 'Model' dropdown only shows BCompany phones. When 'MegaCorp' is selected then the 'Model' dropdown only shows MegaCorp phones:
|
Example 2
Use Filter by option with multiple filters to show specific phones in the 'Mobile phone' dropdown, depending on the selected manufacturer, model, storage capacity and color in the respective dropdowns.
- In the template from example 1 create a dropdown form field named 'Capacity' and link it to the 'Capacity' column of the 'MobilePhoneStorageCapacity' data source.
- Expand Filter options then click
Add filter
. In the Filter by field select 'Model'. The result looks like this:
- Create a dropdown field named 'Color' and link it to the 'Name' column of the 'MobilePhoneColors' data source.
|
- Create a dropdown field named 'MobilePhone' and link it to the 'Name' column of the 'MobilePhones' data source.
- Expand Filter options then click
Add filter
. In the Filter by field select 'Manufacturer'. - Click
Add filter
again and select 'Model'. - Click
Add filter
again and select 'Capacity'. - Click
Add filter
again and select 'Color'. The result looks like this:
|
- Now when a user selects a manufacturer, model, capacity and color the 'Mobile phone' dropdown field only shows phones that match the filter. If nothing is selected then by default the 'Mobile phone' dropdown will show all records:
Example 3
Instead of linking to a form field it's also possible to link to a user profile field.
- In the Admin Center in the User Profile create a dropdown form field named 'Color' and link it to the 'Name' column of the 'MobilePhoneColors' data source.
- In Dynamics Designer open the 'Color' filter from step 8 of example 2. Select the 'Color' from the User Profile instead of the Form:
- Optional: you can now delete the form field 'Color' because it's not used anymore.
- When a user now sets the color in the user profile to 'White' then the 'Mobile phone' dropdown will only show white phones. When the color in the user profile is set to 'Black' then only black phones are shown.
Related articles
Comments
0 comments
Article is closed for comments.