How to access existing filters on ObjecSet?

Hello,

How can I access the existing filters applied on an Object Set?

My application filters “Assets” by linked Objects. I’m using the Exploration search bar in Workshop to do this. However, I’d also like to extract the linked object filters and actually apply them to the linked objects in a separate object set.

Example:

  • take Assets and related Components
  • filter to Assets with Components where colour is red or blue
  • :white_check_mark: get correctly filtered Assets

At this point things get tricky. I’d like to:

  • extract the filters applied on the linked Components (colour is red or blue)
  • apply this filter to all Components
  • get the Components which are red or blue

Best,
Aron

hi,

For the ontology you described Assets → Components, we recommend configuring two FilterLists widgets:

- FilterList for Components
  outputs: componentsFilter

- Variable:  assetsFilteredByComponentFilter
  input: assets
  linkedObjectFilter: componentsFilter

- FilterList for Assets
  input: assetsFilteredByComponentFilter
  outputs: assetsFilter

this way you have both the filter for the components and assets available to you

Is there any way I can check whether a filter is applied? (this way I can avoid evaluating filters that haven’t been set)

Are filters on linked objects just intersections in the backend? I’m afraid that the number of intersections I’m doing will make the workflow very slow.

when passing an empty filter to filter by linked objects, the objects will be filtered by existence of a link

we have a feature request tracking a variable transform that would check if a filter variable is empty, right now the best way to do this check is via checking if an objectSet is empty. You can create an objectSet that is base objectSet minus filtered objectSet, if the resulting objectSet is empty then the filter was empty.

@aszekely, the Workshop team just started a project to allow builders to access and manipulate the contents of an Object Set Filter variables within Workshop’s front-end variable transformation system. So, help is on the way here, and there should be a series of first-class options for this within the Workshop front-end in the next few months.

3 Likes