Double nesting a deref

Banging my head against a wall here.

Let’s say I have 3 tables.

Student

columns - StudentName, StudentID

Class

columns - ClassName, ClassID

and a many-many join table named

Enrollment

columns - EnrollmentID, StudentID, ClassID, Status (where status is pass/fail)

I have all the refs and reverse refs set up. Now I need to show in a Student view a list of the classes the Student is failing. I keep going in circles playing with chained derefs and filters but can’t seem to make this seemingly simple thing work. Any idea what I am missing?

When querying Related columns there is a little quirk to it….first lets check the basic setup.

If you have your Ref’s set up properly, AppSheet should automatically provide you a list of “Related Enrollments” in BOTH the Class and Student tables.

The Class table will be based on the ClassID - i.e. the list of Student enrolled in that class.

The Student table will be based on the StudentID providing a list of classes that Student is enrolled in.

I will assume you also have another column in the Enrollments table EnrollmentID actually as the tables primary key. I would use a dedicated column for this - not one with concatenated values!!!

I think I would create a virtual column in the Student table and get the “Failed Enrollments” for a particular Student like this:

SELECT([Related Enrollments][Enrollment ID], [Status] = “fail”)

Then if I wanted ALL Students with failed Enrollments, I would create a Slice of Students where ISNOTBLANK([Failed Enrollments])

You may need to adjust these expressions based on school year/enrollment year.

If you have a different need, please provide details.

I hope this helps!!

4 Likes

Thanks for the quick reply! I will take a look. I updated my original question to clarify that I do in fact have a UUID field on the Enrollments table as well.

3 Likes

This worked. I was all around the right answer but being an idiot with my references. Thanks for the quick reply!

3 Likes

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.