The problem you describe is related to the incorrect configuration of “relationships” or the application of filtering rules in the Adalo platform. Here are the steps you can take to fix it:
Root causes of the problem
Lack of proper relationships between collections:
The collections “County”, “School” and “Student” must be properly linked using Relationships. If the relationships are not configured correctly, the system will not be able to link the data properly.
Incorrect filtering criteria:
If the filter is not applied to the selected “County” or “School”, the system will return all results from all records.
How to configure the database and filters correctly
-
Creating Relationships
County collection:
Create a Schools field with a One-to-Many relationship with the School collection.
School collection:
Create a “Students” field with a One-to-Many relationship with the “Student” collection.
Also add a “County” field with a Many-to-One relationship to associate a school with a specific county.
Student collection:
Create a “School” field with a Many-to-One relationship to associate a student with a specific school.
-
Filtering data by relationships
Once you have the relationships configured correctly, make sure you have set up the right filters:
County screen:
Display a list of all counties from the County collection (no additional filters are required).
School screen (click on County):
Configure the filter to show only schools that belong to the selected county:
Filter the Schools collection by the “County” field:
County = [Selected county]
Student screen (by clicking School):
Filter the “Students” collection by the selected school:
School = [Selected School]
Individual Student (click Student):
Displays the individual student record that is directly related to the selected student.
3. Transfer of the Selection via screens
For filtering to work correctly, you must use the Magic Text or Logged Data function to transfer the selected item (e.g. county, school or student) to another screen. Here’s how to do it:
County screen → School screen:
When you click on a county, pass the selected County to the School screen as a context variable.
School screen → Student screen:
When you click on a school, pass the selected “School” to the “Student” screen.
Student screen → Student details screen:
When you click on a student, pass the selected Student to the Student details screen.
Typical error: unused links or missing filters
If the data filters are not properly set or the relationships are not configured, the system will return all records but not the related data. This explains why you see a list of all schools or students regardless of the selected county or school.
Conclusion
Solving this problem requires two things:
Properly configure the relationships between the County, School and Student collections.
Use filters and pass the selected items through the screens so that only related data is displayed.
If you are still experiencing problems after making these changes, it may be worth checking that all links and filters are properly combined and passed using the Magic Text function.