On This Page
Overview
To filter items by metadata, the target platform must support metadata. If the target platform does not support metadata, the "Metadata Content" custom filter will be disabled.
Filtering metadata is not supported when using the Metadata Import function. Any metadata content filters configured with Metadata Import will be ignored.
To filter metadata content, both the Filtering and Scripting options need to be enabled on the Advanced setting page. The Metadata Mapping option should not be enabled.
The following example excludes the item that is associated with value "Doe1" or "Doe2" for the property value LName metadata column on the Source platform.
Format:
[Property]="Text 1" OR [Property]="Text 2"
[Property]=Numeric Value 1 AND [Property]=Numeric Value 2
Identify the Columns to Filter on
Populate the property name value that corresponds with metadata content column.
{ "transfer" : { "metadata_map": { "schemas": [ { "mappings": [ { "source": { "property": { "name": "LName", "type": "string" } }, "destination": { "property": { "name": "LName", "type": "string" } } } ] } ] } } }
Filter Using REST API
For metadata filtering, the type
attribute can use filter_metadata
or metadata
. Both configurations work the same. If the target platform does not support metadata, the filter
or text
definition for the given connection will be ignored.
In addition, metadata filtering rules (rules
block) can be defined using either a filter
block or text
attribute. Filters (filter
blocks) include name
, op
, and value
attributes, name
is the metadata field name, op
is one of the operators defined in the table below, and value
is the metadata value used for the comparison. All three attributes are required, even with the empty
and not_empty
operators. When empty
and not_empty
operators are used, ensure to configure the value to represent an empty state (e.g. "value": ""
).
Text (text)
values must be in a string format with quotes around the value escaped and brackets around the field name (e.g. "[ProtectionLevel]=\"Sensitive\""
). Numeric values do not need to be contained in quotes.
Multiple metadata filters may be joined by AND
or OR
conjunction clauses. There are two ways to define conjunctions; filters
or text
. These methods are based on the filter
and text
methods described above.
Attributes
Operator ( | Description | Equivalent |
|
|
---|---|---|---|---|
eq | equals | = | "filter": { "name": "ProtectionLevel", "op": "eq", "value": "Sensitive" } |
|
ne | not equals | <> or != | "filter": { "name": "ProtectionLevel", "op": "ne", "value": "Sensitive" } |
|
lt | less than | < | "filter": { "name": "ProtectionLevel", "op": "lt", "value": 100 } |
|
le | less than or equal to | <= |
|
|
gt | greater than | > |
|
|
ge | greater than or equal to | >= |
|
|
starts_with | starts with |
|
|
|
not_starts_with | does not start with |
|
|
|
ends_with | ends with |
|
|
|
not_ends_with | does not end with |
|
|
|
contains | contains | = |
|
|
not_contains | does not contain |
|
|
|
in | includes all the | IN |
|
|
not_in | does not include all the | NOT IN |
|
|
empty | the |
|
|
|
not_empty | the | ="*" |
|
|
Example 1
The following example will include any files on the source that have a metadata field named "ProtectionLevel" with value of 50 or 100.
{ ... "transfer": { ... "filter": { "source": [{ "action": "include", "rules": [{ "filter": { "conjunction": "or", "filters": [{ "name": "ProtectionLevel", "op": "eq", "value": 50 },{ "name": "ProtectionLevel", "op": "eq", "value": 100 }] }, "type": "filter_metadata" }], "type": "filter_rule" }] } } ... }
Example 2
The following example will include any files on the source that have a metadata field named "ProtectionLevel" with value of 50 and "Author" equal to "John.”
{ ... "transfer": { ... "filter": { "source": [{ "action": "include", "rules": [{ "rules": [{ "text": "[ProtectionLevel]=50 AND [Author]=\"John\"", "type": "metadata" }], "type": "filter_rule" }] } } ... }