Enable saving of object set filters in Workshop

Currently it is not possible to save the object set filters to an object. i.e. object set filter is not assessible by for example Functions to write an ontology edit function to writeback to an object.

Workflow is as follows:

  1. We generate a list of objects that could be interesting to our users
  2. The object information is displayed in workshop
  3. We want our user to use the filtering functionality in workshop (either filter pills or the filter in the table) to select down the objects they want.
  4. The filters should be saved so that going forward when there are new objects that come in, they are captured for the users. The filters will be shared across different users.

Technically it means that there needs to be a way for user to save the filters and writeback to ontology, so that we can use it again in the object, and also downstream in the pyspark layer again from materialization

1 Like

Hey, I might be missing the mark, but it sounds what what you might want is filter variable value extraction. You can already save a filter as a variable, but now you can specify that when the filter’s value changes, it should writeback to the variables defined in its default. By doing this you can keep track of values that you are filtering on in other variable, and then use those how you would like (pass along to a function or action, use as interface variable, etc.).

Let me know if I am misunderstanding your use case here.

1 Like

thanks for your response.

My exact use case is a bit more complex than that where the value extraction approach might not fully work. Let me explain:

  • we have an object where user defines a filter and we want to save it (for this your proposed value extraction approach would work)
  • but then we want to package the Workshop app into MarketPlace via DevOps so that we can deploy to multiple clients (each having the same object type but with slightly different property schemas - some have more columns than the others)
  • Using the value extraction approach requires me to hardcode every single property in the Object Set Filters widget, but that wouldn’t work if you want to deploy the app to an object with dynamic schema
  • so what is actually helpful is a way to stringify your JSON for the object set filter itself, and then writeback to another object. WHen we query this again next time, we can always parse the JSON and pass the object set filters back to the widget…

Hi @hfcheung we had the exact same requirement. we wanted to let users freeze their filters as a property of a „review object“ to save the exact state of „what they were looking at“ for other users. we managed to get it working - I’d say by shooting through the knee into the heart (or should I better say slate ;-)). I‘ll look for the details tomorrow but so far the concept.

  • you need to go via an embedded slate module. you pass in the object set you want to stringify the filter
  • within slate you actually have a „stringify filter“ function (that is not the name)
  • then you pass back the stringified filter and just safe this as a property of your object type
  • the same way works the other way around. You can read such stringified filter to create in slate object set again.
    If I remember correctly there where some challenges with calling the „save“ event through a button click from the parent workshop module. But I can get the details from my developer how we solved that.

P.s. to anybody using this forum on a phone: is the text input box for you also nearly unreadable thin (literally 1.5 visible lines)? :sweat_smile:

Hi @Phil-M

That’s an interesting approach.

I’m curious to understand your step 2 more. When you pass a filtered object set into Slate, how do you stringify the filters from the object set within Slate?

Edit: Now also with functioning screenshots :v:

Hi! Sorry for the late reply!

so this is how it flows. we use one slate module for both directions.

From Object Set to Stringified Filter :
we pass this filtered object set of into slate named “modified-default-filter”

it gets passed and saved in slate as “v_modifiedDefaultFilterJSON”

Here is how the function looks:

The function outputs “f_modifiedDefaultFilterAsString”, that is sent back to workshop under the id “updated-default-filter-string”

Et violĂ ! In workshop the stringified filter will look like this:

From Stringified Filter to Filter variable :

To go backwards we pass in the “saved-filter-string”

The stringified filter gets converted via this function and returned to workshop:

I hope this helps!

1 Like

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.