If you are using FileMaker 13 or later you can use the "Hide object when" option in the Inspector in the Data tab.
Assuming you have set up the relationship, use a condition like (obviously filling in your table occurrence name and id field name) :
IsEmpty ( RelatedTable::Id )
The object will be hidden if there isn't a related record.
Well the issue is that the contact can have multiple roles. So on the list view for every role the contact is associated with I want a different object to be displayed.
Can you please describe the structure of the related records? What are the relevant fields and table occurrence names and how are they related?
1 of 1 people found this helpful
If you have multiple objects that could be displayed depending on whether the person has certain roles, and each person could have multiple roles (in related records), you could create individual objects for each possible role and then attach a Hide Condition as follows:
not Position ( List ( RelatedTable::role ) ; "Director" ; 1 ; 1 )
This will hide the object if the person does not have a related record with the role field set to "Director".
Awesome, that's what I needed! Thanks!
Not IsEmpty ( FilterValues ( List ( RelatedTable::role ) ; "Director" ) )
This avoids false matches due to partial string matching such as one test that looks for "Director" and another that looks for "Director of Finance" or some such where the first text is a substring of the other.
I've used this so much that I've created a custom function, InList, that allows me to just specify the list and the value as parameter with a boolean result returned to the expression that called the function.