Overview
Filters in Integration Manager define criteria for fetching data from Pricefx. The simplest filters use a single <criterion> element inside an <and> block. Each criterion specifies a field name, an operator, and (for most operators) a value to match against.
Complete XML Examples
Equals Operator
Match records where a field has an exact value:
<filters>
<filter id="filterByStatus">
<and>
<criterion fieldName="attribute1" operator="equals" value="ACTIVE"/>
</and>
</filter>
</filters>
Not Equal Operator
Exclude records with a specific value:
<filters>
<filter id="excludeDeleted">
<and>
<criterion fieldName="attribute14" operator="notEqual" value="88"/>
</and>
</filter>
</filters>
Contains and iContains (Case-Insensitive)
Match records where a field contains a substring:
<filters>
<filter id="filterByNameContains">
<and>
<!-- Case-sensitive contains -->
<criterion fieldName="label" operator="contains" value="Premium"/>
</and>
</filter>
<filter id="filterByNameCaseInsensitive">
<and>
<!-- Case-insensitive contains -->
<criterion fieldName="attribute17" operator="iContains" value="Test"/>
</and>
</filter>
</filters>
StartsWith Operator
Match records where a field starts with a given prefix:
<filters>
<filter id="filterBySku">
<and>
<criterion fieldName="sku" operator="startsWith" value="PROD-"/>
</and>
</filter>
</filters>
NotNull Operator
Select records where a field has any non-null value (no value attribute needed):
<filters>
<filter id="filterNonNullLabels">
<and>
<criterion fieldName="label" operator="notNull"/>
</and>
</filter>
</filters>
Empty And Block (Fetch All Records)
An empty <and> block with no criteria fetches all records:
<filters>
<filter id="fetchAllProducts">
<and/>
</filter>
</filters>
How It Works
-
<filters>is the root wrapper element containing one or more<filter>definitions. -
<filter id="...">defines a named filter that can be referenced from route endpoints viafilter=filterId. -
<and>wraps criteria that must all be true (logical AND). Even a single criterion needs an<and>wrapper. -
<criterion>attributes:-
fieldName-- the Pricefx object field to filter on (e.g.,sku,label,attribute1). -
operator-- the comparison operator (equals,notEqual,contains,iContains,startsWith,notNull,greaterThan,lessThan,iBetween, etc.). -
value-- the value to compare against (omitted for unary operators likenotNull).
-
-
Filters are used with fetch endpoints:
pfx-api:fetch?objectType=P&filter=filterByStatus.
Common Pitfalls
-
Missing
<and>wrapper: Every filter must have at least one<and>or<or>block. A<criterion>directly inside<filter>is not valid. -
Case sensitivity:
equalsis case-sensitive. UseiEqualsoriContainsfor case-insensitive matching where available. -
Value type: The
valueattribute is always a string. Pricefx performs type coercion based on the field type server-side, but mismatches can cause unexpected results. -
Empty filter performance: An empty
<and/>fetches ALL records. For large datasets, always add criteria or useresultFieldsto limit the response. -
Operator spelling: Operators are camelCase (
notNull,notEqual,startsWith). Incorrect casing will produce an error.