How to reset/clear old custom state on a RG cell's elements when data changes?

In each cell of my RG, I have an icon whose appearance I change with custom states, based on user interaction with it. I also have filters that can be changed that will refetch new data each time a filter input changes. However, when new data comes in, it appears to bind the new data with the old cells’ visual states, which leads to incorrect appearances.
What’s the best way to force Bubble to re-render each cell from scratch / clear old state when new data shows up in a RG (or any group for that matter)?

Hey! Try adding a workflow step where you change your RG data to change the visual appearance of an icon. Or use only one state and show icon change based on RG state (this is simpler, IMO). Let me know if you need more help with it.

Are you suggesting creating a custom state on the RG, e.g. setting something only when the RG is loading? And then always setting the icon state based on this?

However, the icon is not a function of RG state, but a function of user interaction with the icon. I suppose I could try to reset the icon state by also making it a function of both (RG state + icon state), but that sure doesn’t sound simpler.

Actually, I can’t even get a simple Workflow to trigger on RG is loading is "yes" :frowning: (It’s currently pulling from another Group’s data source, which is what is refreshing when the filters change - this was an optimization to share its data source in a couple of places). Hmm, even moving the query directly into the RG’s Data source doesn’t seem to trigger the is loading condition, regardless of yes or no. Now I don’t even know what that built-in RG state is supposed to represent, and it’s sure not helping me reset the custom state of my cells…

You can save the rg data in a custom state and compare the rg values with “do when a condition is true”. If they are not identical means the rg is changed and this will trigger the workflow. Then you can do anything you want under that workflow.

How would you access the UI components of your cells from outside the cell though? I can see the current cell is selectable in a workflow (e.g. set state of an elementaction) when it was triggered from an element in that cell, but if a workflow is triggered from outside, I cannot manipulate cells.

And there doesn’t seem to be a general way to signal to the RG that it should not necessarily recycle the old cell layouts when data changes or at least offer a way to re-bind data to the UI when it changes.

I can check the app if you share the editor link.