> For the complete documentation index, see [llms.txt](https://docs.copia.io/docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.copia.io/docs/devicelink/basic/omron-sysmac-studio/smart-filter.md).

# Smart Filter

{% hint style="info" %}
For Rockwell Studio/RSLogix 5000 Smart Filter, please visit: [Smart Filter](/docs/devicelink/basic/rockwell-logix-designer/smart-filter.md)
{% endhint %}

{% hint style="info" %}
For Rockwell RS Logix 500 Smart Filter, please visit: [Smart Filter](/docs/devicelink/basic/rockwell-rslogix-500/smart-filter.md)
{% endhint %}

## Overview

One challenge when comparing backups of a certain Project is managing project items whose values change for in every backup or that aren't necessary to track changes for across backups. Currently this feature is limited to **Rockwell and Omron projects only**.

For example, tag values such as timer accumulators and counters may change every backup, but these changes aren't significant enough to warrant a backup being counted as Modified. Or a non-data related value like "DateModified" might change inadvertently for a backup after transferring from an Omron controller.

{% hint style="warning" %}
In Copia nomenclature, NJ/NX controllers are referred to as "devices"
{% endhint %}

With Copia's Smart Filter feature, you can apply various rules to your project to refine your backups to only keep track of changes that are relevant to you. Currently, for Omron Sysmac Studio, this feature is limited to **XML-based** files within Sysmac Studio project files.&#x20;

## Configuring the Smart Filter

The Smart Filter configuration file is located at `.copia/smart-filter.yaml` in your Source Control repository. To access the configuration file for a specific project, you can click *Manage Smart Filter* in the popup menu.

Before enabling the Smart Filter, you'll first need to declare your configurations. Choose the *Add Config to Enable Smart Filter* link.

<figure><img src="/files/rZQIkZ4OzTR6ScfxOVdn" alt=""><figcaption></figcaption></figure>

This will take you either to the existing Smart Filter configuration file for this project or prompt you to create a new one depending on if there's already a configuration in the repo associated with your project.

The Smart Filter configuration file is a YAML file that applies a set of rules to the entire repo. **It must live in the default branch of your repo (this is usually&#x20;*****master*****&#x20;or&#x20;*****main*****)**. An example configuration file is as follows:

{% hint style="info" %}
If you are adding this to an existing smart-filter.yaml file, the first lines may not be needed, and you can copy the portions below the `projects:` line.
{% endhint %}

```yaml
# Smart Filter Configuration
# For more information about Smart Filter, see the documentation: https://docs.copia.io/docs/devicelink/advanced/smart-filter

version: 1

projects:
  # All Omron Sysmac Studio files, regardless of extension capitalization, within any directory
  '**/*.{[sS][mM][cC],[sS][mM][cC]2,[cC][sS][mM],[cC][sS][mM]2,[sS][lL][rR]}':
    type: omron-sysmac-studio
    exclude:
      - //DateModified
      - //DateCreated
      - //LibraryId

```

{% hint style="warning" %}
YAML files are sensitive to tabs vs. spaces. Please indent using spaces **only**
{% endhint %}

The `version` field specifies which version of the Smart Filter config you are using (currently, it should always be `version: 1`).\
\
The `projects` field is a list of XPaths (You can refer to [the Mozilla documentation](https://developer.mozilla.org/en-US/docs/Web/XML/XPath) for assistance). Please note that each XPath query will apply to all Project Items with valid xml. To view a Project Item's xml, click the **Show XML** View Option in the file viewer.

<figure><img src="/files/G3ixewlyzyOuY9eBo5uF" alt=""><figcaption></figcaption></figure>

If a Project Item does not source from a valid xml file, the Smart Filter will not apply.

| ✅ Smart Filter Will Apply        | ❌ Smart Filter Will Not Apply                                       |
| -------------------------------- | ------------------------------------------------------------------- |
| ![](/files/HzzZrKCS4XWyvLkwQOpV) | <img src="/files/KqGZX5C3cVe26WsOIyfy" alt="" data-size="original"> |

{% hint style="info" %}
If you'd like to pre-check your XPath entries xml files, you may visit this [XPath Testing Website](https://extendsclass.com/xpath-tester.html)
{% endhint %}

## Change Detection

The config for the Smart Filter will also impact whether the backup reports differences found in the Project. Any items that are filtered from the diff view will also be filtered when checking for differences between the Project in the repository and the Project on the Device.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.copia.io/docs/devicelink/basic/omron-sysmac-studio/smart-filter.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
