Why Filter?
Without filters, an export automation sends every product or order in your account. An import automation processes every record in the vendor file against every record in your SureDone account. That is rarely what you want. Filters let you narrow the scope: only export products that changed in the last 24 hours, only match imports against orders with a specific status, only process items with stock greater than zero.
Filters save time, reduce unnecessary API calls, and prevent unintended changes to records that should not be touched.
The search Field
The simplest way to filter is with the search field inside file_configs. It takes a string using SureDone search syntax -- the same syntax you use when searching products or orders in the SureDone UI or API.
"file_configs": [
{
"search": "stock:>0 condition:=New",
"field_map": {
"guid": "SKU",
"title": "ProductName",
"price": "Price"
}
}
]
This export only includes products where stock is greater than zero AND condition equals "New".
Search Operators
| Operator | Syntax | Example | Meaning |
|---|---|---|---|
| Equals | field:=value |
status:=active |
Exact match |
| Not equals | field:-=value |
status:-=ended |
Does not equal |
| Contains | field:"text" |
title:"Widget" |
Contains text |
| Does not contain | field:-"text" |
title:-"Refurbished" |
Does not contain text |
| Empty | field:= |
price:= |
Field is empty |
| Not empty | field:-= |
price:-= |
Field has a value |
| Greater than | field:>value |
stock:>0 |
Greater than |
| Greater or equal | field:>=value |
price:>=9.99 |
Greater than or equal |
| Less than | field:<value |
price:<100 |
Less than |
| Less or equal | field:<=value |
stock:<=5 |
Less than or equal |
| Date relative | field:>"date string" |
dateupdatedutc:>"-1 day" |
After a relative date |
Combining Conditions
AND logic -- Separate conditions with a space. All must be true:
"search": "stock:>0 condition:=New brand:=Acme"
Products must have stock > 0, condition = New, and brand = Acme.
OR logic -- Wrap conditions in parentheses. At least one must be true:
"search": "(brand:=Nike brand:=Adidas brand:=Puma)"
Products with brand Nike, Adidas, or Puma.
AND + OR combined -- Parentheses for OR, spaces for AND:
"search": "(brand:=Nike brand:=Adidas) stock:>0 condition:=New"
Products where brand is Nike or Adidas, AND stock > 0, AND condition is New.
Common Search Patterns
Export recently updated products:
"search": "dateupdatedutc:>\"-1 day\""
Export active products with stock:
"search": "stock:>0 status:-=ended"
Import only orders with a specific status:
"search": "itemstatus:=READY"
Exclude certain brands:
"search": "brand:-=TestBrand brand:-=SampleBrand"
Filter on a custom field:
"search": "amznminprice:-="
This exports only products where the Amazon minimum price field is not empty.
The filters Array
For more complex logic, you can use the filters array -- a structured alternative to the search string. Filters support nested AND/OR boolean logic with explicit operators:
"filters": [
{
"key": "stock",
"opr": ">",
"val": "0"
},
{
"key": "condition",
"opr": "=",
"val": "New"
}
]
By default, all filters in the array are combined with AND logic. To change this, set the filter_type property to "OR" in the same file_configs entry.
Each filter object has three properties:
| Property | Description |
|---|---|
key |
The SureDone field name |
opr |
The operator: =, !=, >, >=, <, <=, like, not like, in, not in |
val |
The value to compare against (use an array for in and not in) |
The like operator supports SQL-style wildcards with %:
{
"key": "order",
"opr": "like",
"val": "%walmart%"
}
Nested AND/OR Groups
For complex boolean logic, you can nest filter groups. Instead of a key/opr/val leaf, use a filterType and filters sub-array:
"filters": [
{
"key": "stock",
"opr": ">",
"val": "0"
},
{
"filterType": "OR",
"filters": [
{ "key": "brand", "opr": "=", "val": "Nike" },
{ "key": "brand", "opr": "=", "val": "Adidas" }
]
}
]
This matches products where stock > 0 AND (brand is Nike OR brand is Adidas).
search overwrites filters. If you include both search and filters in the same file_configs entry, the search field will replace the filters array during processing. Use one or the other, never both. If you need simple conditions, search is easier to write. If you need complex nested logic, use filters.Filters for Imports vs. Exports
The search/filters configuration works in both directions, but the behavior differs:
For exports: The search determines which items or orders are pulled from your SureDone account to be exported. Only records matching the search are included in the output file or API call.
{
"type": "products",
"action": "export",
"file_configs": [
{
"search": "stock:>0 condition:=New",
"field_map": { "guid": "SKU", "price": "Price" }
}
]
}
Only products with stock and "New" condition are exported.
For imports: The search determines which existing SureDone records are eligible for update or deletion. Only SureDone items or orders matching the search are pulled for matching against the incoming vendor data. Vendor records whose identifier matches a pulled SureDone record will be updated; vendor records that do not match any pulled record follow the create path (if configured). Items or orders that exist in SureDone but were excluded by the search will not be updated or deleted, even if a vendor record has the same identifier.
{
"type": "orders",
"action": "import",
"file_configs": [
{
"search": "itemstatus:=READY",
"field_map": { "source": "source", "itemstatus": "itemstatus" }
}
]
}
Only existing SureDone orders where itemstatus equals "READY" are eligible for update. The vendor file is still fully processed, but updates will only apply to orders that matched the search.
Order-Specific Search
When exporting orders, you can search on both order-level fields (like status, oid, total) and item-level fields (like sku, itemstatus, quantity). The engine evaluates the search against the full order context.
"search": "itemstatus:= (oid:=3160 oid:=3161) status:-=COMPLETE status:-=CANCELED"
This exports orders where itemstatus is empty, the order ID is 3160 or 3161, and the status is not COMPLETE or CANCELED.
When combined with order_payload_line_item and order_payload_line_filter, you can further control which individual line items within an order are included in the export:
{
"search": "supplier:=Acme",
"order_payload_line_item": true,
"order_payload_line_filter": true
}
With order_payload_line_filter set to true, even if an order matches the search, only the individual line items that also match are included. Line items that do not match are filtered out.
Tips
Start broad, then narrow. When building an automation, begin without a search filter to verify the full pipeline works. Then add filters to focus on the records you care about.
Use search for readability. For straightforward conditions like "stock > 0 and status is active," the search string is more concise and easier to scan than a filters array.
Watch for relative dates. Expressions like dateupdatedutc:>"-1 day" are evaluated at runtime in UTC. Make sure you account for timezone differences when working with date-based filters.
Test your search in the UI first. The same search syntax works in SureDone's product and order search bars. Try your filter there before putting it in an automation config to verify it returns the expected results.