Add conditional filter based on previous page

Hi all,

I have 3 tables that I want to present with Softr, but I’m struggling with the filtering. Can you help me out?

Tables

  1. Courses
  2. Students
  3. Assignments

Flow

  • User opens a course from the overview of courses
  • A list detail block shows details of that course AND a list block shows all students participating in that course (with conditional filtering)
  • A student can be in multiple courses. But when the user clicks on one of those students within the overview of a specific course, I want to only show the assignments of that student for this particular course

Filtering out all assignments of the concerning student isn’t a problem with conditional logic. But that also shows assignments from other courses. So how do I add an extra filter to this for the course from the page the user comes from?

Here how you should do.
The first three screenshots are related to the Airtable database setup

The last three screenshots are related to the Softr studio setup

You can see at the end a GIF on how it works live (with very basic data, from the Airtable tables I showed above)

Does it fit your need? The assignments are set by courses or by student? One assignment per student/course or multiple assignments per student/course?

Capture
Capture3
Capture5
Capture7
Capture9
Capture11
ezgif-3-de33da515e

1 Like

Thanks for taking the time to help me with this @matthieu_chateau :pray:

This is almost what I’m looking for, however instead of showing the assignments in the list block with the students (as in Capture11), I want to open those on a separate page.

This separate page then should show some details of the concerning student (list detail block) and the assignments of this student for this particular course. So the information of the records you show in capture 11, but then on a student detail page.

Depending on which course a user is looking at, the student detail page would only show the relevant assignments.

Do you know a solution for this as well?

Solved with this suggestion from @Julien_Berawen in Slack:

Hey Harold, it looks like your Courses><Students relation is of the “many-to-many” type, which could render things harder, like filtering on a specific couple. What I think I would do is use a join table in between these two (you could call that table “Enrollments”) and then link Assignments to Enrollments.
Here is an example (coincidentally with the exact same tables as yours ).
Once you do that, on a course details page, instead of displaying a list of students , you would display a list of enrollments (which you could style so that it only shows the students’ names and looks exactly like a list of students). You would then proceed to an enrollment details page, showing assignments linked to that enrollment.

Thanks Julien!

1 Like