What are Filters?
Filters are tools to limit the data that is transferred during integrations. They are like rules that decide what information from one system should be passed to another.
When Should You Use Filters?
Filters should be used when you only need certain data from your source system. For example, if you only want to bring over plans marked for import into OnePlan, filters will make sure only those plans are transferred, removing any irrelevant data.
Where Do You Apply Filters?
Filters can be applied in two ways:
- Scheduled Strategies: These are strategies that run automatically based on a set schedule.
- Event-Driven Strategies: These strategies are triggered by an event, such as user action or an automatic system trigger.
Scheduled Strategy Filters
You can apply filters in the integration's Schedules section. Each row represents an instance of a scheduled strategy.
Make sure the filter is applied correctly (e.g., OnePlanPublish filters should be used when exporting data from OnePlan).
Event-Driven Filters
Event-driven filters can be applied in the integration's Mappings > Filters section.
These filters are not tied to a specific strategy; instead, they are applied based on the data flow direction and the type of data table (e.g., Plans, Resources, WorkPlan).
Example:
Let's say you're transferring resource data to OnePlan. You could apply an event-driven filter that only allows resources with a specific status (e.g., "Active") to be transferred. If the resource Id is for a resource whose status is not Active, the resource will not be brought over or updated.
Pre-Filter Functionality
Some integrations offer pre-filters. These are helpful when working with very large datasets. Check your integration settings to see if this option is available and where to apply the filters.
Filter Anatomy
Filters have four main parts:
- Select Field: The field you're applying the filter to, such as "Status."
- Select Operator: Defines the type of comparisong, like "equals", or "greater than."
- Value Field: The specific value you're looking for like "Active."
- Logical Connector: Connects multiple conditions. Use "AND" (all conditions must be true) or "OR" (only one condition needs to be true).
Once you've set up the filter, click Save. A Filter Expression will appear for reference, but it cannot be changed.
Filtering on and Comparing Date Fields
When directly comparing with a date field (e.g., Due Date = 2000-12-31), setting up the filter remains straightforward.
However, when dealing with comparisons like Created Date >= 2000-12-31, the filter may not function as intended. For proper date field comparisons, please ensure that you use the 'yyyy-mm-dd' format and that the date value is enclosed within number signs (e.g., Created Date >= #2000-12-31#).
Filter Best Practices
Test Filters one at a Time
It's best to apply filters with just one value at a time. Setting and using multiple filters can create unexpected results, so focusing on one filter at a time ensures more accurate data transfer.
Filters Should be Inclusive
When configuring filters, it's best practice to use inclusive criteria (e.g., Status = Active). Using exclusive filters (e.g., Status <> Closed AND Status <> New) can lead to confusion, as to what gets filtered out may not align with expectations. It's important to ensure that the filtering logic is clear and intentional to avoid unintended results.
Filter Limitations
Not All Strategies Support Filters:
Some strategies don't have filter capabilities. Check your integration documentation to see if the strategy you're working with supports filters.
Filters Only Apply to Mapped Fields
Filters can only be applied to fields that have been mapped in the Mappings > Fields sections. The field names in the dropdown menu will match the programs field name.
Filters Only Apply to Certain Tables
Filters can't be applied to all tables in your integration. If you're unsure which tables support filters, consult your integration documentation.
Limited logical Conditions
Filters currently only support simple logical conditions. More complex logic across multiple queries is not yet supported.