How to apply list filter condition on any widget
We can filter the choice list options using the list filter condition.
Steps to set the List filter condition-
You need to create 2 forms –
For example, we will create a student form and refer the district form to the student form. There is a college list in the student form and we need to filter the college list based on the district selected.
To achieve this, we will be needing 3 forms-
1. Student form
2. District form
3. College form
District form creation steps –
- Navigate to form builder tab.
- Create a form (District) that will be used as a reference for the student form.
- Add some widgets in the reference form – for example, District name (textbox)
- Save the form
College form creation steps –
- Navigate to form builder tab.
- Create a form (College) that will be used as a reference for the student form.
- Add some widgets in the reference form – for example, 1. College name (textbox), 2. District (Choice list)
- Click on the District field and click on the “Data source” property and select option as “Reference list“.
5. Select the “District” form as a reference in the “Reference to” property. We added this to specify the district of the college.
Student form creation steps –
- Create a form (Student)
- Add some widgets in the Student form – 1. Student name(Textbox), 2. District (Choice list) and 3. Select college (Choice list)
- Click on district choice list and click on “Data source” property.
4. Select the Reference list option from the list.
10. Click on the “Reference to” property.
11. Select the Reference form from the list, here we will select the District form.
12. Click on the Select College field and select the “Data source“property as a reference list.
13. Select the “College” form in the “Reference to” property.
12. Now we need to filter the colleges, so we need to apply the list filter condition on the college field. Click on the Condition not specified link in the list filter section of the College choice list.
13. Click on + Sign
14. Select the respective fields and operator as-
a. Field- Identifier of the District field from the college form. As we need to compare the sort the college list based on the district.
b. Operator- Contains
c. Field- Identifier of the District field from the Student form itself. As we need to compare the district from the college form with the district in the student form.
15. Save the form and publish the app
16. Navigate to Fill form section and Submit multiple records in the reference forms like (For example, submit 2 records in the district form, 2 records in the College form)
17. Open the Student form and click on the District choice list field and select any district. For example, Pune
18. Click on the college choice list.
Here you will see the list of colleges in which you have entered the above district only, as we have applied the condition that lists the records that contain district which is similar to the district in the college form.
So here, the only colleges from the Pune district will be listed down here. And from this list, we can select any of the options.
0 Comments