Https://community.palantir.com/t/enable-saving-of-object-set-filters-in-workshop/2653/6 @Phil-M

Continuing the discussion from Enable saving of object set filters in Workshop:

Hi,

Can anyone guide how can I initialize an ObjectSetFilter variable in workshop through a function or json string to be used in widgets like exploration pills?

Let’s say I managed to persistently save ObjectSetFilter as a string on new ObjectType. I can then return it back either as json or string using custom function. However, how do I return it back/as ObjectSetFilter variable?

{
  "and": {
    "filters": [
      {
        "objectType": {
          "objectTypeId": "..."
        },
        "type": "objectType"
      },
      {
        "parameterizedExactMatch": {
          "propertyId": "analytic_exclusion",
          "terms": [
            {
              "resolved": {
                "value": false
              },
              "type": "resolved"
            }
          ]
        },
        "type": "parameterizedExactMatch"
      },
    ]
  },
  "type": "and"
}

I see some nice solution here by @Phil-M. But unclear on how ObjectSetFilter can be re-intialized using JSON string even let’s say there is a custom function to return raw json.

If a function returns raw json, would it be automatically intialized as ObjectSetFilter?

Thank you.

Hi @rajwanir :slight_smile: in our case the conversion from json to object set filter variable happened in the configuration of the slate iFrame interface variable within workshop. If it is an option for you, you could have a 1px sized iFrame handling this part of variable transform.
I will check tomorrow our communication with pally support from back then if they had other proposals for the conversion back part. I am not certain, but I think we were discussing options how to do this in a ts function. The stringifying part was more the issue why we had to go the knee-to-heart slate route.