Query filters (Channel Filter or Filters in Fields) help to restrict the values available for tagging in a tagbox e.g. show only products for EMEA; or the Content Items displayed in a specific Channel e.g. only approved product marketing content. Those filters do not require user input, they have a fixed return set based on specific criteria e.g. show only Arrangements, show only current employees, show only players from Real Madrid. Query filters are available for channels, fields (Tagbox, Relationship), via API (searching content, creation of channels, tagbox fields, relationship fields, or lists). Query Filters are code, there is no editor. 

Create Filters in Tagboxes from Default Values

Create Filters in Tagboxes from Default Values

Prerequisites:

Goal:

  • In a Tagbox "Focus Theme" we only want to show active values and concepts.

    • We need to have two criteria, which both must be met: AndFilter.

    • We need to check for a term in the field state: TermFilter.

    • We need to check for a term in the field classification: TermFilter.

Using Tagbox Default Values

Picturepark offers some help when building a query filter for a tagbox. You can assign default values and let Picturepark build the filter based on those default values. 

  1. Edit the Tagbox 

  2. Open the tab "Default Values"

  3. Assign the desired values

  4. Open the tab "General"

  5. Find the "Item Filter"

  6. Press "Select from default values"

VIDEO: How to Use Default Values for Tagboxes in Layers:

Create Filters in Tagboxes from Code Examples in Manual

Create Filters in Tagboxes from Code Examples in Manual

Prerequisites:

  • Field “Focus Theme”

    • ID: focusTheme

    • Connected List: Controlled Vocabulary

      • Field: Classification (controlledVocabulary.classification.name)

        • ID: classification

        • Connected List: Classification

          • Field: Name

          • ID: name

      • Field: State (controlledVocabulary.state.name)

        • ID: state

        • Connected List: State

          • Field: Name

          • ID: name

Goal:

  • In a Tagbox "Focus Theme" we only want to show active values and concepts.

    • We need to have two criteria, which both must be met: AndFilter.

    • We need to check for a term in the field state: TermFilter.

    • We need to check for a term in the field classification: TermFilter.

Using documented query filters

  1. Find the documented Query Filters

  2. Find the required Query Filters

    1. AndFilter

    2. TermFilter

  3. Copy and paste the code examples as you need them Picturepark will format the code for you on save.

  4. Update missing fieldpath working with the suggestions shown when clicking on the underlined value. 

VIDEO: How to Create Filters in Tagboxes from Code Examples in Manual:

Create Filters in Tagboxes from Monacco Editor Intellisense

Create Filters in Tagboxes from Monaco Editor Intellisense

Prerequisites:

  • Field “Focus Theme”

    • ID: focusTheme

    • Connected List: Controlled Vocabulary

      • Field: Classification (controlledVocabulary.classification.name)

        • ID: classification

        • Connected List: Classification

          • Field: Name

          • ID: name

      • Field: State (controlledVocabulary.state.name)

        • ID: state

        • Connected List: State

          • Field: Name

          • ID: name

Goal:

  • In a Tagbox "Focus Theme" we only want to show active values and concepts.

    • We need to have two criteria, which both must be met: AndFilter.

    • We need to check for a term in the field state: TermFilter.

    • We need to check for a term in the field classification: TermFilter.

Using Monacco Editor Intellisense

The Monaco Editor offers some IntelliSense which is basically some coding help. Find some explanations for the Monaco Editor in the frameworks section. Especially helpful is: Ctrl + Space to get suggestions. 

  1. Edit the Tagbox 

  2. Find the "Item Filter" in the opened tab "General"

  3. Click into the empty field

  4. Press Ctrl + Space

  5. Add the empty filter object: {}

  6. Press Ctrl + Space

  7. Choose kind to select your filter

  8. "AndFilter" is by default added

  9. Add a comma

  10. Press Ctrl + Space

  11. See the properties required for the AndFilter

  12. Repeat steps 6 - 11 until you have your Query Filter. 

VIDEO: How to Create Filters in Tagboxes from Monaco Editor Intellisense:

Types of Query Filters

Check all solutions for query filters here.

And Filter

And Filter

Show Content with Layer Corporate and Event, but only images.

{
    "kind": "AndFilter",
    "filters": [
        {
            "kind": "TermFilter",
            "field": "layerSchemaIds",
            "term": "CorporateLayer"
        },
        {
            "kind": "TermFilter",
            "field": "layerSchemaIds",
            "term": "EventLayer"
        },
        {
            "kind": "TermFilter",
            "field": "contentSchemaIds",
            "term": "ImageMetadata"
        }
    ]
}
CODE

Basic Filter

All the provided criteria must be met.

{ 
    "kind": "AndFilter", 
		"filters": [ 
        	{ filter1 }, 
        	{ filter2 } 
		] 
}
CODE

Properties

kind

string, required

filters

one or multiple, Array of object, Nullable

Items with Layer Product Details AND Layer Product Marketing

// Complete example
{
    "kind": "AndFilter",
    "filter": [{
        "kind": "TermFilter",
        "field": "layerSchemaIds",
        "term": "ProductDetails" // ID of Layer, capitalized
    	},
		{
		"kind": "TermFilter",
        "field": "layerSchemaIds",
        "term": "ProductMarketing" // ID of Layer, capitalized
		}
	]
}
CODE


Or Filter

OR Filter

Show Corporate or Event Content in a Channel.

{
    "kind": "OrFilter",
    "filters": [
        {
            "kind": "TermFilter",
            "field": "layerSchemaIds",
            "term": "CorporateLayer"
        },
        {
            "kind": "TermFilter",
            "field": "layerSchemaIds",
            "term": "EventLayer"
        }
    ]
}
CODE

Basic Filter

One or more of the provided criteria must be met.

{ 
    "kind": "OrFilter", 
	"filters": [ 
		{ filter1 }, 
		{ filter2 } 
	] 
}
JSON

Properties

kind

string, required

Filters

One or mutliple

Array of object, Nullable

Items with Layer Product Details OR Layer Product Marketing

// Complete example
{
    "kind": "OrFilter",
    "filter": [{
        "kind": "TermFilter",
        "field": "layerSchemaIds",
        "term": "ProductDetails" // ID of Layer, capitalized
    	},
		{
		"kind": "TermFilter",
        "field": "layerSchemaIds",
        "term": "ProductMarketing" // ID of Layer, capitalized
		}
	]
}
CODE


Not Filter

Not Filter

Hide Stock content; Not the content with Layer Stock Info applied.

// Complete example
{
    "kind": "NotFilter",
    "filter": {
        "kind": "TermFilter",
        "field": "layerSchemaIds",
        "term": "StockInfo"  //Layer_ID capitalized
    }
}
JSON

Basic Filter

Not the provided criteria.

{
    "kind": "NotFilter",
    "filter": { filter1 }
}
JSON

Properties

kind

string, required

Filter

only one

object, required (one filter)

Not the Items with Layer Corporate Information

// Complete example
{
    "kind": "NotFilter",
    "filter": {
		"kind": "TermFilter",
		"field": "layerSchemaIds",
		"term": "CorporateInformation"  //ID_OF_LAYER capitalized
	}
}
JSON

Nested Filter for Multi Tagboxes

Nested Filter for Multi Tagboxes

Also for multi relationship fields and multi fieldset fields.

Layer Corporate assigned, but no events tagged in the Corporate Layer.

{
	"kind": "AndFilter",
	"filters": [
		{
			"kind": "TermFilter",
			"field": "layerSchemaIds",
			"term": "CorporateLayer"
		},
		{
			"kind": "NestedFilter",
			"path": "corporateLayer.events",
			"filter": {
				"kind":"NotFilter",
				"filter": {
					"kind": "ExistsFilter",
					"field": "corporateLayer.events._refId"
				}
			}
		}
	]
}
JSON

Basic Filter

Filter on criteria from nested documents (multi tagboxes, multi relations, multi fieldsets, not translations) e.g. product numbers from a list which is assigned via product information tagbox.

{ 
	"kind": "NestedFilter", 
	"path": "fieldpath", 
	"filter": 
		{ filter1 } 
}
JSON

Properties

kind

string, required, e.g. “NestedFilter”

path

The path pointing to the nested document (i.e. personLayer.nestedAddress). The whole collection of tags (my array). 

filter (single)

The filter to be applied for nested documents, basically which value you want to get from the array of nested values. 


Layer Assigned and Events Tagged in Layer

// LAYER CORPORATE ASSIGNED AND EVENTS TAGGED IN LAYER
{
	"kind": "AndFilter",
	"filters": [
		{
			"kind": "TermFilter",
			"field": "layerSchemaIds",
			"term": "CorporateLayer"
		},
		{
			"kind": "NestedFilter",
			"path": "corporateLayer.events",
			"filter": {
				"kind": "ExistsFilter",
				"field": "corporateLayer.events._refId"
			}
		}
	]
}
JSON

Single Term Filter

Single Term Filter

Filter for Content with the Migration Layer added and the term “Product” as keyword assigned.

{
    "kind": "AndFilter",
    "filters": [
      {
        "kind": "TermFilter",
        "field": "layerSchemaIds",
        "term": "MigrationLayer" //Layer ID capitalized
      },
      { 
		"kind": "NestedFilter", 
		"path": "migrationLayer.keywords", 
		"filter": {
          "kind": "TermFilter",
          "field": "migrationLayer.keywords.name",
          "term": "Product"
          } 
      }
    ]
}
JSON

Basic Filter

Filter for content that have the exact term in a field. Can be used for single tagbox directly. For multi tagbox a nested filter must be used in combination with the term filter.

The term must be an exact match.

{ 
	"kind": "TermFilter", 
	"field": "fieldpath", 
	"term": "Europe" 
}
JSON

Properties

kind

Required

Which filter to use, as string e.g. "TermFilter"

field

Required

The field's name to execute the filter on. It is composed by the field ids of the hierarchy joined with "." (i.e. personLayer.address.region).

term

Required

The value in the field, to be used as term. It must be an exact match, so The term filter on "Europe" does not find "Western Europe", but only "Europe".

Multiple Terms Filter

Multiple Terms Filter

Items with all Layers assigned.

{ 
	"kind": "TermsFilter", 
	"field": "layerSchemaIds", 
	"terms": [ 
		"CorporateLayer", 
		"MediaLayer", 
		"GeneralLayer"
	]
}
JSON

Exclude Images, Videos, Virtual Press Kits.

{
  "kind": "NotFilter",
  "filter": { 
	"kind": "TermsFilter", 
	"field": "contentSchemaId", 
	"terms": [ 
		"PressKit", 
		"ImageMetadata", 
		"VideoMetadata"
	]
  }
}
JSON

Basic Filter

Filter for content that has the exact term in a field. It can be used for single tagbox directly. For multi tagbox, fieldset and relation use the Terms filter inside the Nested Filter.

Each term must be an exact match.

{ 
	"kind": "TermsFilter", 
	"field": "layerId.fieldId", 
	"terms": [ 
		"Germany", 
		"Austria", 
		"Switzerland"
	]
}
JSON

Properties

kind

Required

Which filter to use, as string e.g. "TermsFilter"

field

Required

The field's name to execute the filter on. It is composed by the field ids of the hierarchy joined with "." (i.e. personLayer.address.region).

terms

Required array Array of terms which must be as value in the field, to be used as term. It must be an exact match. The terms "Europe" does not find "Western Europe", but only "Europe".

All Items with Inappropriate Keywords (Content Moderation)

{ 
	"kind": "NestedFilter", 
	"path": "autoTagging.matches", 
	"filter": { 
		"kind": "TermsFilter", 
		"field": "autoTagging.matches.name.en", 
		"terms": [ 
			"Alcohol", 
			"Drugs", 
			"Tobacco"
		]
    } 
}
JSON

Exists Filter

Exists Filter

Content Items where in the Layer Corporate Events are tagged (_refId exists).

{
  "kind": "NestedFilter",
  "path": "corporateLayer.events",
  "filter": {
    "kind": "ExistsFilter",
    "field": "corporateLayer.events._refId"
   }
}
JSON

Basic Filter

Show all content where a specific field exists in the metadata profile or content profile.

{ 
  "kind": "ExistsFilter", 
  "field": "corporateInformation.copyright" 
}
JSON

Properties

kind

Discriminator, string, required

field

The field's name to execute the filter on. It is composed of the field ids of the hierarchy joined with "." (i.e. personLayer.address.street).

"layerId.fieldId"

Examples

Show content with the copyright field available, therefore the admin knows which images have copyright information and which content needs to be checked for correct copyright information.

Date Range Filter

Date Range Filter

Show content modified in December 2020.

// USING EXACT DATES
{
	"kind": "DateRangeFilter",
	"field": "audit.modificationDate",
	"range": { 
		"names": { 
			"fieldId.en":"Dec 2020",
			"fieldId.de":"Dez 2020"
		},
		"from": "2020-12-01T00:00:00.000",
		"to": "2020-12-31T00:00:00.000",
	}
}
JSON

Show content with a publish date in the last 30 days.

// USING DAY CALCULATIONS
{
	"kind": "DateRangeFilter",
	"field": "corporateInformation.publishDate",
	"range": { 
		"names": { 
			"fieldId.en":"Last 30 days"
			"fieldId.de":"Letzte 30 Tage"
		},
		"from": "now-30D",
		"to": "now"
	}
JSON
// USING COMBINATIONS
{
	"kind": "DateRangeFilter",
	"field": "corporateInformation.embargoDate",
	"range": { 
		"names": { 
			"fieldId.en":"Last 30 days"
			"fieldId.de":"Letzte 30 Tage"
		},
		"from": "now-30D",
		"to": "now"
	},
	{ 
		"names": { 
			"fieldId.en":"Last fiscal year"
			"fieldId.de":"Last fiscal year"
		},
		"from": "2019-03-31T01:02:02.000",
		"to": "2020-03-31T01:02:02.000"
	}
}
JSON

Picturepark supports

  • Y (years), M (month), D (days), H (hours), m (minutes)

  • Calculations starting with now e.g. now+30D, now-30D

  • Anchor dates and rounding are not supported (e.g. Jun 5th + 30d; now/M for the current month)

Basic Filter

Only content with a date/date-time value in the specified range.

Date Format: YYYY-MM-DDTHH:MM:SS:MMM

  • Year-Month-DayTHour-Minute-Second-Millisecond

{
	"kind": "DateRangeFilter",
	"field": "fieldpath",
	"range": { 
		"names": { 
			"fieldId.en":"english text shown to the user",
			"fieldId.de":"german text shown to the user"
		},
		"from": "YYYY-MM-DDTHH:MM:SS:MMM",
		"to": "YYYY-MM-DDTHH:MM:SS:MMM",
	}
}
JSON

Properties

kind

Discriminator, string, required

field

The field's name to execute the filter on. It is composed of the field ids of the hierarchy joined with "." (i.e. personLayer.address.street), check DateTime field values

range

If no range provided, the filter will throw an error "query execution failure" and display it as empty. 

names

The translations of the ranges are nullable, language-specific range names

from

it can be a date-time string or a pattern: now(+-)(int)(YMDHm).

to

it can be a date-time string or a pattern: now(+-)(int)(YMDHm).

Number Filter

Number Filter

Only Items between 150 and 300 width

{
	"kind": "NumericRangeFilter",
	"field": "fileMetadata.width",
	"range": { 
		"names": { 
			"fieldId.en":"low res",
			"fieldId.de":"low res"
		},
	"from": "150",
	"to": "300"
	}
}
JSON

Basic Filter

Filter content that has a numeric field value in the configured range.

{
	"kind": "NumericRangeFilter",
	"field": "layerId.fieldId",
	"range": { 
		"names": { 
			"fieldId.en":"low res",
			"fieldId.de":"low res"
		},
	"from": "0",
	"to": "150"
	}
}
JSON

Properties

kind

Discriminator, string, required

field

The field's name to execute the filter. It is composed of the field ids of the hierarchy joined with "." (i.e. personLayer.address.street), check the DateTime field.

range

The range for the value of the numeric field.

If no range provided, the filter in facets shows an error "query execution failure.". At least one range is required.

names

The translations of the ranges. The values are nullable (can be empty), if provided contain language-specific range names

from

A whole or decimal number.

to

A whole or decimal number.

Prefix Filter

Prefix Filter

Show only technical documentation for admins, which based on an existing file naming convention starts with “ADMIN”. We have to use the Nested Filter as the Media Type is a multi tagbox.

{ 
	"kind": "NestedFilter", 
	"path": "productDocumentation.mediaType", 
	"filter": {
		"kind": "PrefixFilter",
		"field": "productDocumentation.mediaType.code", 
		"prefix": "ADMIN"
	}
}
JSON

Basic Filter

Filter for content that has the defined prefix as the value in a defined field. This works best for fields that have a fixed prefix e.g. if you work with codes INT for internal, or SOCIAL for social media content.

{ 
	"kind": "PrefixFilter", 
	"field": "fieldpath", 
	"prefix": "Anniversary" 
}
JSON

Show content that has the prefix "anniversary" in the field for event name, to only show anniversary events.

Properties

kind

Required

Which filter to use, as string e.g. "PrefixFilter"

field

Required

The field's name to execute the filter on. It is composed by the field ids of the hierarchy joined with "." (i.e. personLayer.address.street).

prefix

Required The value in the field, to be used as prefix.

Product Codes starting with FRU

Best suited for products following a strict naming convention. As you can add a prefix to your Camera for file naming you can also prepare the content with the correct "prefix" before uploading to Picturepark.  See here a Nikon tutorial on file naming. 

{ 
	"kind": "PrefixFilter", 
	"field": "productLayer.products.code", 
	"prefix": "FRU" 
}
JSON


Geo Bounding Box Filter

Geo Bounding Box Filter

Show only content created in Aarau.

{ 
	"kind": "GeoBoundingBoxFilter", 
	"field": "fieldpath", 
	"topLeft": { 
		"lat": 47.4117082, 
		"lon": 8.0569206, 
	}, 
	"bottomRight": { 
		"lat": 47.3854459, 
		"lon": 9.0569206, 
	} 
} 
JSON

Behavior

Creates a rectangle of geo points using TopLeft (1) and BottomRight (2) points and filters for the content which Geo Point values are inside this rectangle.

Properties

kind

Required

Which filter to use, as string e.g. "GeoBoundingBoxFilter"

field

Required

The field's name to execute the filter on. It is composed of the field ids of the hierarchy joined with "." (i.e. personLayer.address.region).

topLeft

The top left corner of the bounding box's geolocation (latitude and longitude).

lat

Latitude value (decimal value)

lon

Longitude (decimal value)

bottomRight

The bottom right corner of the bounding box's geolocation (latitude and longitude).

lat

Latitude value (decimal value)

lon

Longitude (decimal value)


Geo Distance Filter

Geo Distance Filter

Show all Picturepark partners near Berlin, 50km radius. This way your sales people can get an easy overview of partners to visit or to invite for a specific partner event.

{ 
	"kind": "GeoDistanceFilter", 
	"field": "layerId.fieldId", 
	"location": { 
		"lat": 52.5200, 
		"lon": 13.4050, 
	}, 
	"distance": 50000 // DISTANCE IN METERS
}
JSON

Basic Filter

Geo values at position e.g. all images from Aarau and 100m distance (radius).

{ 
	"kind": "GeoDistanceFilter", 
	"field": "layerId.fieldId", 
	"location": { 
		"lat": 47.4117082, 
		"lon": 8.0569206, 
	}, 
	"distance": 100 
}
JSON

Properties

kind

Required

Which filter to use, as string e.g. "GeoDistanceFilter"

field

Required

The field's name to execute the filter on. It is composed by the field ids of the hierarchy joined with "." (i.e. personLayer.address.region).

location

The top left corner of the bounding box's geo location (latitude and longitude).

Lat

Latitude value (decimal value)

Lon

Longitude (decimal value)

distance

The distance in meters from the point of origin (location).

Show only Customers in my Region

Show all customers 200km from my location, so I know which ones to include in my marketing campaigns.

{ 
	"kind": "GeoDistanceFilter", 
	"field": "keyAccountCustomers.headquarter.location", 
	"location": { 
		"lat": 40.7128, 
		"lon": 74.0060, 
	}, 
	"distance": 200000
}
JSON