Relationship inside choice values

Here is the situation I am in. My app is managed by the teacher who assigns course to students. So teach selects a student, then on the next screen, she selects the subject and the period. So, selecting a subject is a Choice component and selecting the period is another independent choice component.

Our calendar is not periodic. That means we cannot simply display stuff for a single week and repeat. We have to display for a month or two or three. As a result, lots of periods to pick from if we do not filter properly.

Right now, no matter what the subject is, the list of periods to select from is always the same. But in reality, each course has its periods. In my cases, there is a huge overlap between the periods of the different courses but there are also unique periods per courses.

So, what I have been trying to do is have periods that depend on courses. Once you select the subject, we display only the periods related to that subject.

At the data model, what I tried to do is use a relation to link the subject to the periods. This way I could have a key connect them. Once you select a subject, the period choice component would show only the periods with the similar key as the subject. However, it doesn’t seem like I can use relations inside choice component.

The other approach that I had tried is display the subject as a list. And when you click on a subject, you get a list of period on the next screen. But with too much screens, you loose the context.

I also looked that the multiselect concept inside https://concepts.glideapp.io/. The challenge is that from one level to the next level the data is being copied. That means if I have 10 subjects and 20 periods, I could easily end up with 200 entries in my table. Not easy to manage at all.

The other thinking I had is to use the filter. In the period sheet I would have a category key that tells me what the period refers to: math_period, math_english_period, etc. I would then have these tags as keys to link subjects and periods. Inside the filter I would say: display only if the period tag is similar to the subject tag. But again, the filter’s value can only be hardcoded value. Maybe templates could be used here? I don’t know.

So, I am out of ideas. Thoughts?

1 Like

Hi,

Take a look at my demo about this interesting case (that causes headaches at the beginning :slight_smile: )

Relations inside a choice component are possible and work but if they are in a Form, is another case and will not work unfortunately

Saludos!

1 Like

Thanks for your response. Unfortunately my case is within a form.

I know, I already walked on that way!

I have a plan B to these cases and I’m testing it. It works almost 90% but the 10% left is giving me other kinds of headache. If I get to fix it I will let you know

Saludos

Could you share your app? I might have a solution. But need to see first. No need to set app to copy. Just want to see it.

Tx