SyncSets

Modified on Wed, 13 Apr 2022 at 09:31 AM

This article is outdated, you can access the most current version here:   https://doc.onedata.de/apps/apps-docs/odml-documentation/AppBuilder/sync-sets/SyncSets.html


SyncSets are a way to propagate filters between different datasources and elements.

They allow to slice and dice individual subsets of the datasets of the application to be able to take a closer look at the data that matters.

A SyncSet configuration looks like this:


  {
    "id": "syncSetMonkeys",
    "sources": [
      "monkeys",
      "fruits"
    ],
    "joins": [
      {
        "datasource": "monkeys",
        "columns": [
          "eats"
        ]
      },
      {
        "datasource": "fruits",
        "columns": [
          "name"
        ]
      }
    ],
    "syncMap": [
      {
        "source": "monkeys",
        "targets": [
          "fruits"
        ]
      },
      {
        "source": "fruits",
        "targets": [
          "monkeys"
        ]
      }
    ]
  }


The properties used in the example above have the following meanings: 

Property
Type
Description
sourcesarrayThe datasources involved in this SyncSet
joinsarrayMappings between columns of different datasources. In the example, eats and name are mapped
syncMaparrayMappings of which datasource (source) influences which other datasources (targets)


In this example, we link the fruits and the monkeys datasets via the "name" and "eats" columns respectively. Filters applied to the eats column will also be applied to the fruits' "name" column, if elements are set up accordingly (see below).

Additionally, you need to specify the SyncSets in the configuration of your elements, e.g:


  {
    "id": "monkeyTable",
    "type": "table",
    "syncSets": [
      {
        "syncSetId": "syncSetMonkeys",
        "applyFilters": true,
        "publishFilters": true
    }
  },
  {
    "id": "fruiTable",
    "type": "table",
    "syncSets": [
      {
        "syncSetId": "syncSetMonkeys",
        "applyFilters": true,
        "publishFilters": false
    }
  }

The meanings of the properties in each syncSets-item are as follows:

PropertyTypeDescription
syncSetIdstringThe syncset to connect the element to
applyFiltersbooleanWhether or not to apply filters from other elements
publishFiltersbooleanWhether or not to notify other elements about filter changes
onlydirectlyPropagatedFilters
boolean
The implicit filtering works by calculating the distinct values for the columns in the syncSet config, even if the filter is on another column. With "onlyDirectlyPropagatedFilters" set to true, elements won't apply those implicit filters but only from columns mentioned in the syncset config. This can help cover use cases where multiple elements affect each other and the existing behavior "over-filters" the datasets. This flag default is set to false, so unless you set it to true, the behavior will stay the same for your app.

Be aware that "applyFilters" and "publishFilters" also influence the results of a filter. It's always a triad of "applyFilters", "publishFilters" and "onlydirectlyPropagatedFilers".

In our example, if we set a filter on the "eats" column of monkeys, the table with fruits will also update, showing only the fruits we selected.

Was this article helpful?

That’s Great!

Thank you for your feedback

Sorry! We couldn't be helpful

Thank you for your feedback

Let us know how can we improve this article!

Select atleast one of the reasons

Feedback sent

We appreciate your effort and will try to fix the article