Leaving Index page resets all dropdowns to null, removes data from Repeating Group

I am using the Cata.Log template from zeroqode, with some changes.

My index page has a series of dropdowns, user selects from these and the selections feed conditions on Repeating Group, to pull data from the bubble database.

User can then click on one of the returned items (cell), and the user is taken to another page (Details) in my app. I pass over the Thing and display the details of this Thing.

When I click the back button in browser, to go back to index and maybe click on a different item, or maybe to change the dropdowns, all the data is gone. The repeating groups are empty.

How can I persist the selections the user made, and therefore the data?

(think of a car search…you search and then tap on a car to see the details. You then click back button and your search results should all remain. but for me right now, the search results are gone.)

Anyone?

You’ll have to save the data somewhere in the database. You can set the drop-down selection as auto-binding.

Else, you can navigate the user to a new tab for displaying the details.

@brianandrews6629 The solution is to use URL parameters.

That’s about all the time I have right now but that’s the term to search the forum for.

If you can’t figure it out, I’ll try to take some time next week to jump in a bit deeper with you.

1 Like

There’s almost always more than one solution :slight_smile: but as Eli has correctly pointed out - URL parameters can be a great one.

What you can do is whenever the user is entering anything in any of the inputs\dropdowns - you send this parameter via Navigate to current page command, adding the parameter.

This will not reload the page, but keep essentially all of your entered values in the URL.

Likewise, you will need to adjust the inputs to take the current values from the URL when the page is loaded.

Et voila! Each time you’re going back&forth, all the user inputs are kept in the URL thus nothing gets lost.


Another alternative is to create something like a “Current Input” object, and store it at the current user level, so whenever the user provides any of his inputs, the data is being saved to one of the fields of that object, and if the page gets reloaded, the initial values of all the inputs are being pulled from the Current Input object field values.

Hope all of that makes sense :slight_smile:

Good luck Bubbling this one out for yourself :sunglasses:

Thank you very, very much. I really appreciate this.

I’ve spent some time, and I’m going to spend more. I am now re-calling Index, passing in the parameters, didn’t know I could do that!

but right now I see two issues:

  1. I am using multi dropdowns. I do not see an “Initial Content” property on the multi-dropdown. So how do use “get data from page URL”? I tried on “Default Value” but when I try this there is some incompatibility because this stays red.

  2. I am using a series of pop-ups, like a wizard, to get the users’s prompts. Right now, the only items that are appearing in the index page’s URL are the 4 inputs from the last pop-up. I am setting parameters on the other pop-ups, but seems when they hide and then call another pop-up, the parameters don’t stick?
    This isn’t major, because I can change the UI to just have one pop-up screen with all 7 of my prompts. Just wondering if I’m missing something.

Here you can see three parameters, which are all from my last pop-up. the parms from other pop-ups are not present in the URL.
Screen Shot 2020-03-01 at 1.35.08 PM

Note the “Type of choices” is Weather, so the Default value will also need to be a thing of type Weather. Probably you want a search for Weather, and a search condition uses the text value from the page URL.

Sounds odd, changing to a different popup shouldn’t undo the URL parameters, unless when the popup hides, the dropdowns change value and re-trigger the workflow action? Is there a setting of data for the popup?

1 Like

I did notice that sometimes toggling popup view does disrupt the URL params.

I did not yet figure out the pattern here, but will most prolly shoot a bug request when I do.

1 Like

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