Jump to content
Server Maintenance This Week. ×

Display Grandchildren in a Portal


stxlen

Recommended Posts

  • Newbies

Been awhile since I picked up FileMaker so I'm sure I'm missing some simple logic here but could use some help

I would like to display a portal with grand-child records. I am using relationships to filter records. I am trying to show the status of who is out (unavailable) to train in one portal, and in another, who is active (available) and is an Attacker. The out table is working, but it's the active and attacker that is not.

I've been walking through my tables/relationships to see where it is breaking.... This image shows that my first few filters are working. 99B65... is the foreign key that links a player's status to the training session. So you see Portal 5 has the wrong foreign key, and is just grabbing the first related record.

image.thumb.png.b47d73ebbe7bf568c25ad77210e8b72a.png

Portal 1 shows I'm grabbing all players for that date correctly
Portal 2 shows I'm grabbing Active players correctly
Portal 3 shows that I'm grabbing Out players correctly
Portal 5 shows I am not grabbing Active and Attackers correctly.

Here are the relationships:

image.thumb.png.9c004a7dbc7b11297de52e23e46c63c3.png

So it's the relationship between 2 & 5 that isn't displaying properly.... or, which is more likely,  I'm not using the correct table on the portal perform this filter.

Edited by stxlen
hit ctl+enter instead of shift+enter and accidentally published prematurely
Link to comment
Share on other sites

I wasn't able to follow your explanation.

In general, if you want to display a portal with grandchild records, you should define the portal to show records from the grandchild table. If you also want to display data from the child table in the portal, you need to do one of the following:

  • either place another TO of the child table "behind" the grandchild TO, and place fields from this TO in the portal; or:
  • define calculation fields in the grandchild table to get the data from the child, and place these in the portal.

If you placed fields from the "intervening" TO of the child table (the one sitting between the parent and the grandchild) in the portal, they will always show data from the first related record in the child table (from the POV of the parent), regardless of which grandchild record is displayed in the portal row.

If this doesn't answer your question, consider reducing the example to the minimum necessary to show the problem and post a demo file.

 

Link to comment
Share on other sites

  • Newbies
16 minutes ago, comment said:

define calculation fields in the grandchild table to get the data from the child, and place these in the portal.

I think this may be the route I'm looking for, but I guess it's my understanding of how portals filter. In my mind, it's an additive/subtractive process. So above... Table 1 to 2 filters to keep only active individuals, and then 2 to 5 takes only active individuals and further filters to only retain attackers. But this is not how it seems to behave, 2 to 5 takes all records and keeps attackers, regardless if they are active or not.

So if I' thinking through this properly, my filtering process must be done via one relationship  - one step, instead of the two steps I'm using -  and then any grandchildren from there need just be to look up related records on a one-to-one relationship?

Link to comment
Share on other sites

4 minutes ago, stxlen said:

how portals filter.

That's not a good term to use here. Portals do not filter unless they are defined to filter in portal setup, which I understand is not the case here. Portals show related records. True, you could say that a relationship "filters" in the sense that it passes only related records. But that would be confusing because the term "filter" is taken.

Now, I don't see how exactly your relationships are defined and, as I said, I don't understand the situation you describe.

 

Link to comment
Share on other sites

I will say one more thing in general:

A portal to a grandchild table shows all grandchild records that are related to the current parent record. How does Filemaker determine if a grandchild record is related? First, it determines which child records are related. Then, from the POV of the child table, it determines which grandchild records are related to any of related children. In this step, the only thing that matters is the relationship between child and grandchild.

I get the vague impression that you expect only grandchildren that satisfy the condition expressed by the parent-child relationship to be related (I am assuming we are talking about self-joins here, something which you never said). But that is not how it works.

 

Edited by comment
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.