Combining Filter Conditions
Most real-world filters require multiple conditions. Precision Bridge supports logical connectives to combine conditions into complex queries.
Logical Connectives
AND
All conditions must be true for a record to pass the filter. This is the default when you add multiple conditions in the filter builder.
[status] = "active" AND [priority] <= 2
This extracts only records that are both active AND have a priority of 2 or less.
OR
At least one condition must be true for a record to pass the filter.
[category] = "hardware" OR [category] = "software"
This extracts records in either the hardware or software category.
Tip: When using OR on the same field with equality checks, consider using the
Inoperator instead:[category] in ["hardware", "software"]is equivalent and cleaner.
NOT
Negates a condition or group of conditions.
NOT [status] = "closed"
This is equivalent to [status] != "closed", but NOT becomes more useful when negating complex groups.
Nesting Conditions
You can group conditions using the filter builder to create nested logic. Groups define which conditions are evaluated together.
Example: Mixed AND/OR
[status] = "active" AND ([priority] = 1 OR [priority] = 2)
Without grouping, operator precedence could produce unexpected results. Always use groups to make your intent explicit.
Example: Complex Nested Filter
[status] != "closed" AND (
([priority] = 1 AND [category] = "production")
OR
([priority] <= 2 AND [assigned_to] is not null)
)
This extracts non-closed records where either: - Priority is 1 and category is production, OR - Priority is 2 or less and someone is assigned
Worked Examples
Example 1: Active High-Priority Records
[status] = "active" AND [priority] <= 2
Extracts only active records with priority 1 or 2.
Example 2: Records in Multiple Categories
[category] in ["hardware", "software", "network"]
Simpler than [category] = "hardware" OR [category] = "software" OR [category] = "network".
Example 3: Unassigned or Overdue
[assigned_to] is null OR ([status] = "open" AND [updated_date] < date(2024, 1, 1))
Finds records that are either unassigned or have been open and untouched since before 2024.
Example 4: Excluding Test Data
NOT [short_description] contains "TEST" AND NOT [category] = "test"
Filters out records that appear to be test data.
Example 5: Complex Production Filter
[active] = true AND (
([priority] in [1, 2] AND [category] = "production")
OR
([priority] = 3 AND [SLA_breached] = true)
) AND [assigned_to] is not null
Extracts active, assigned records that are either high-priority production issues or medium-priority SLA breaches.
Best Practices
- Keep filters simple where possible — complex filters are harder to debug
-
Use
Ininstead of multiple ORs for the same field - Group conditions explicitly — don't rely on operator precedence
- Test your filter before running a full migration to verify it returns the expected records
- Start broad, then narrow — begin with a permissive filter and add conditions as needed
Related Documentation
- Filter Operators — complete operator reference
- Using Variables in Filters — dynamic filter values
- Formulas in Filters — expressions in filter values
Comments
0 comments
Please sign in to leave a comment.