Reset group data - not working

Hoping to confirm this is a bug… I’m basically running into the same behavior reported by @bhage in this thread:

I have a popup and it contains a group where I’m pre-fetching and stuffing an existing Thing from my Db, if one exists. My group contains an icon - which I’m just using for debugging purposes - and the icon is programmed to be visible when the group isn’t empty, i.e. the Thing was successfully fetched and stuffed into the group. When the popup is closed, my workflow “resets the group” and then closes the popup - that’s the plan at least. (Therefore I expect the icon to disappear on closing the popup.)

However, when I re-open the popup, I’m seeing the icon for a moment, even when I know the Thing it’s looking for is not in my database. It seems to be a holdover from the last time the popup was open. The icon disappears once its visbility conditional evaluates and it realizes the Thing is not in the database (as it should). My concern is that the icon’s brief appearance on open is evidence that the reset during popup CLOSE did not work.

Did that make sense? Any suggestions?

What is the default datasource for the group?

And is the Open Popup workflow action also displaying, or resetting, the data in the popup group?

Along with @adamhholmes

Maybe check the order of things. Reset the group, then hide/animate it.

Sometimes that helps too. :blush:

The group’s “Data Source” (doesn’t say “default”) is the search for the aforementioned Thing.

And yes, I have the reset on the group being attempted on both the popup’s close, and also the popup’s open.

Thanks!

Thanks for the suggestion. Order of operation is usually one of the first things I experiment with. I have the group being reset as the very first action when the popup’s “X” / close icon is clicked. Doesn’t seem to help.

1 Like

If I were troubleshooting I would add a slight pause between the reset data and hide popup to test the theory. Maybe it is running out of order.

@J805 thanks, yep - playing with that too. so far, no joy

Just something to bear in mind…

When you use ‘Reset Data’ on a group in a workflow, it ‘resets’ its data to its original datasource (the one set in the group’s properties editor) - it doesn’t set the data to empty (unless the original datasource was left blank).

If you want to set the data of the group to be actually empty you’ll need to do that in a ‘Display Data’ action (not a reset data action, unless the original datasource was empty).

Bubble doesn’t allow you to leave the ‘Data To Display’ empty (in the way it does when setting custom state values), so in order to set the Group’s data to ‘Empty’ you’ll need to do a search for something that doesn’t exist (i.e. search for a Thing who’s created date > current date/time, or something like that).

Either that or leave the Group’s original datasource empty, and set it on pageload instead. That way, using a ‘Reset Data’ action will reset the Group’s data to it’s original setting- i.e. empty.

6 Likes

@adamhholmes - hmm… thanks for the thoughtful and helpful response! Making the group’s Data Source (i.e. initial source) empty and populating it elsewhere (e.g. page load like you suggested) is a good idea - will try that next!

3 Likes

If there’s a Data Source for a group defined, resetting the group will revert it back to the Data Source. Might be best to leave Data Source blank and use either conditionals or other workflows to send data to the group. That way when you reset the group, it should have no data.

Yep, that’s what I ended up doing. Thanks @samnichols

1 Like

This topic was automatically closed after 14 days. New replies are no longer allowed.