I am trying to: Filter a view by using an intermediary post custom field
Link to a page where the issue can be seen: hidden link
I have created a many-to-many relationship between post types 'Insights' and 'Reports'. That relationship has an intermediary post type 'Insights - Report' with custom fields. I am trying to query specific posts of the post types 'Insights' through a custom field 'Insight-Stage'.
I expected to see: One item in the view which has 'Stage 2' selected in the intermediary post 'Insights - Report'.
Instead, I got: No items.
This is an issue I've had on another site also, not being able to query by intermediary post custom field.
Many thanks for your help!
This is not possible, you cannot query a Post Type by fields of another post type, even if its a related post type.
You can query by that related Post type, but not by its fields, and only by one relationship tree a time, each View.
You would have to add your voice for this feature to be implemented at https://toolset.com/home/contact-us/suggest-a-new-feature-for-toolset/:
To be able to filter by related posts fields, in an M2M or O2M relationship.
Right now you'd have to query the very post type you want to filter by fields, so in your case, the relationship post.
Then you could add that View to a Post in a relationship and it would display all relationship posts of that related post and you can filter that by the fields.
Then, in the loop, you can display the other related post, passing an item attribute.
Does this help?