How to conditionally reset / retain Object Set Filter in embedded module when parent selection changes?

Hi all,

I’m trying to solve a state retention issue with an embedded module inside an overlay in Workshop.

Setup

I have:

  • a parent screen where the user makes a selection

  • a button that opens an overlay

  • inside the overlay:

    • a close button

    • an embedded module

The parent screen passes the user’s selection into the embedded module via interface variables.

Inside the embedded module, the screen contains:

  • an Object Set Filter

  • an Object Table

The Object Set Filter is backed by a function-backed Object Set.


Current behavior

The filter state is being retained (apparently via promoted variables, although I did not originally implement that part).

Example:

  1. User selects A in parent screen

  2. Opens overlay / embedded module

  3. Embedded module loads filter options, and filter value 1 is selected

  4. User closes overlay

  5. User later selects B in parent screen

  6. Opens overlay again

  7. Embedded module now has filter options where only 2 is valid

  8. But 1 is still retained/selected from the previous session

This causes the Object Table to show no rows, because the retained filter value is no longer valid for the new parent selection.


Requirement

I need the filter to behave like this:

  • If the current parent selection = previous parent selection, retain the filter

  • If the current parent selection ≠ previous parent selection, reset the filter


What I tried

I introduced:

  • currentSelection

  • previousSelection

currentSelection is passed into the embedded module as usual.

For previousSelection, I configured it to:

  • not compute automatically

  • update on event (specifically when the overlay / embedded module is closed)

So conceptually:

  • when overlay closes → store current selection as previous

  • when overlay reopens → compare current vs previous


Roadblocks

I’m stuck because:

  1. I cannot make the promoted variable conditional

    • It seems like once filter retention is enabled, it persists regardless of whether parent context changed
  2. I cannot reset the embedded module’s Object Set Filter from the parent module

    • From the parent button / overlay open event, I don’t see a way to directly clear or control the embedded module’s filter state

Workaround I am considering

As a workaround, I introduced a button inside the embedded module that is only visible when:

currentSelection != previousSelection

The idea is:

  • if the parent selection changed, user sees the button

  • user clicks it to reset / refresh the filter state for the new context

This is not ideal UX, but it is the only path I can currently think of.


My main questions

Is there a supported way in Workshop / embedded modules to do any of the following?

  1. Conditionally retain an Object Set Filter only when parent context is unchanged

  2. Automatically trigger the event of resetting the filter when the condition is matched

  3. Or otherwise invalidate retained filter state when interface variable inputs change


What I’m trying to achieve

I want users to keep their filter selections only when reopening the same context, but not when they switch to a different parent selection.

If anyone has implemented this pattern before, I’d appreciate guidance on the cleanest supported approach.

Thanks!