SureDone uses a unified search syntax across the entire platform -- the same query language works in the UI, API, bulk exports, and automation engine. This reference covers the syntax as it applies to automations, where search is used in search, vendor_actions, suredone_actions, and order_update_search.
Basic Syntax
The general format for a search term is:
field:operatorvalue
Where field is a SureDone field name, operator is a comparison operator, and value is the value to compare against.
Operators
| Operator | Syntax | Description | Example |
|---|---|---|---|
| Equals | field:=value |
Exact match | brand:=Nike |
| Not equals | field:-=value or field:!=value |
Does not equal | status:-=draft |
| Greater than | field:>value |
Strictly greater | price:>100 |
| Greater than or equal | field:>=value |
Greater or equal | stock:>=10 |
| Less than | field:<value |
Strictly less | weight:<5 |
| Less than or equal | field:<=value |
Less or equal | cost:<=50 |
| Contains (LIKE) | field:value |
Contains substring | title:camera |
| Not contains | field:-value |
Does not contain | description:-discontinued |
| Is empty | field:= |
Field is empty or null | upc:= |
| Is not empty | field:-= or field:!= |
Field has any value | price:-= |
Boolean Logic
AND (Space-Separated)
Multiple conditions separated by spaces are combined with AND. All conditions must match.
stock:>0 condition:=New brand:=Acme
Matches items where stock > 0 AND condition is "New" AND brand is "Acme".
OR (Parentheses)
Conditions inside parentheses are combined with OR. Any condition can match.
(brand:=Nike brand:=Adidas brand:=Puma)
Matches items where brand is "Nike" OR "Adidas" OR "Puma".
Combining AND and OR
stock:>0 (brand:=Nike brand:=Adidas) condition:=New
Matches items where stock > 0 AND (brand is "Nike" OR "Adidas") AND condition is "New".
Wildcards and Matching
| Syntax | Behavior | Example |
|---|---|---|
field:value |
Contains (auto-wrapped with %value%) |
title:widget |
field:value% |
Starts with | sku:ABC% |
field:%value |
Ends with | sku:%001 |
field:^value |
Starts with (alternative) | sku:^ABC |
field:value$ |
Ends with (alternative) | sku:001$ |
field:"exact phrase" |
Exact phrase match | title:"Digital Camera" |
field:*exact phrase* |
Exact phrase match (alternative) | title:*Digital Camera* |
Special Values
| Value | Description | Example |
|---|---|---|
Empty after = |
Field is empty/null | upc:= |
Empty after -= |
Field is not empty | upc:-= |
| Numeric values | Compared numerically for >, <, >=, <= |
price:>19.99 |
| Date strings | Parseable date for date fields | dateutc:>2024-01-01 |
Field-to-Field Comparisons
When the value exactly matches another field name, the system compares the two fields against each other.
| Example | Description |
|---|---|
price:>cost |
Items where price is greater than cost |
saleprice:!=price |
Items where sale price differs from regular price |
stock:<reorderpoint |
Items where stock is below reorder point |
Where Search Is Used in Automations
| Location | Purpose | Applies To |
|---|---|---|
file_configs[].search |
Filter which items/orders are imported or exported | Products, Orders |
vendor_actions[].search |
Conditionally apply actions based on vendor item values | Products, Orders |
suredone_actions[].search |
Conditionally apply actions based on SureDone item values | Products, Orders |
order_update_search |
Only perform order/item updates when search matches | Orders |
search in file_configs
For imports: only items/orders matching the search will be processed (created, updated, or removed). Non-matching items are ignored.
For exports: only items/orders matching the search will be included in the export file or API call.
"file_configs": [
{
"search": "stock:>0 condition:=New",
"field_map": { "..." : "..." }
}
]
search in actions
The search key within vendor_actions or suredone_actions determines whether the action functions in that block are applied to the current item. If the search matches, all functions in the same object execute.
"vendor_actions": [
{
"search": "vendorstock:=\"Out of Stock\"",
"setValue": {"stock": 0}
}
]
When search is omitted from an action block, the functions apply to every item.
order_update_search
Filters which orders receive the updates defined in order_update_export.
"order_update_search": "status:=approved",
"order_update_export": {
"status": "exported"
}
Date Filtering for Orders
Orders support dedicated date range fields in addition to search:
| Field | Description | Example |
|---|---|---|
orders_start_date |
Export orders created after this date | "2024-01-01" |
orders_end_date |
Export orders created before this date | "2024-12-31" |
"file_configs": [
{
"search": "status:=approved",
"orders_start_date": "-7 days",
"orders_end_date": "now"
}
]
These accept any valid date/time string parseable by PHP's strtotime(), including relative dates like "-7 days", "-1 month", and "now".
Common Search Examples
Products
| Use Case | Search String |
|---|---|
| Active products with stock | stock:>0 status:=active |
| Specific brands (OR) | (brand:=Nike brand:=Adidas) |
| Products with a price set | price:-= |
| Products without a UPC | upc:= |
| High-value items | price:>=100 |
| Title contains keyword | title:widget |
| SKU starts with prefix | sku:^ACME |
| Products needing restock | stock:<5 |
| Specific condition, any brand in list | condition:=New (brand:=Nike brand:=Puma) |
| Exclude discontinued | status:-=discontinued |
Orders
| Use Case | Search String |
|---|---|
| Approved orders | status:=approved |
| Orders without tracking | shiptracking:= |
| Orders by payment method | payment:=PayPal |
| Shipped orders | status:=shipped |
| Orders from specific channel | channel:=ebay |
Tips
- All field names in
searchmust use SureDone field names (the left side offield_map), not vendor field names. - Fields used in
searchwithin actions must be mapped infield_maporfield_run. - Exact string matches with special characters should be quoted:
title:="Widget (Blue)". - Commas are stripped from numeric values before comparison.
- All string matching is case-insensitive --
brand:=Nikewill match "nike", "NIKE", etc. - The
searchfield infile_configsoverwrites anyfiltersarray on the same config -- do not use both.