Dynamic View: Show Items Where a Project Exists or Where it Matches the Assigned One
This solution shows how to configure a filter in the field “Dynamic View” based on a multi-tagbox. The field dynamic view will show all content when nothing is found.
This solution shows how to show related projects or without related projects don’t show the dynamic view field at all (if no projects are found).
Instructions
You add the Dynamic View field
You want to have two filters
Show related projects of a multi tagbox
CODE{ "kind": "NestedFilter", "path": "projects.newProject", "filter": { "kind": "TermFilter", "field": "projects.newProject._refId", "term": "{{data.projects.newProject[0]._refId}}" } }
Show nothing if there is no value in the tagbox for projects
CODE{ "kind": "NestedFilter", "path": "projects.newProject", "filter": { "kind": "ExistsFilter", "field": "projects.newProject._refId" } }
For the dynamic view - both filters must be true hence you need an AND filter
JSON{ "kind": "AndFilter", "filters": [ { "kind": "NestedFilter", "path": "projects.newProject", "filter": { "kind": "TermFilter", "field": "projects.newProject._refId", "term": "{{data.projects.newProject[0]._refId}}" } }, { "kind": "NestedFilter", "path": "projects.newProject", "filter": { "kind": "ExistsFilter", "field": "projects.newProject._refId" } } ] }
This filter will show all related projects, and at least one project must exist.
This filter will always include the original content item (the base). If you want to remove the original, you exclude the id from the dynamic view - you can just add this to the AND filter:
- JSON
{ "kind": "NotFilter", "filter": { "kind": "TermFilter", "field": "id", "term": "{{id}}" } }