How to keep value in form when hiding it

Hi,

is there a way to keep value in the form when hiding it ?
My goal :
display a form with customs fields for filtering a list in the bottom of the page.
Then, I want to hide the form when the list is filtered, but when I hide the form, the list disappear because values didn’t exists.

Any solution to solve this ?
Thanks !!!

Hi @sKuD,

Welcome to the forum!

Not sure how did you set up a form to store values (??), may be you are meaning Input component.

If you hide the input via left pane, it becomes unavailable. What you can do is to minimise the input and make it white, so it still remains on the screen, but isn’t visible to a user.
Another option (worked before for me) is to have a separate screen, where I put all these inputs to store temporary values.

Best regards, Victor.

Hi Victor,

thanks for your reply.
Yes I use input component. I don’t see how minimize this input or make it white with a button action …
At the start, I used a modal for filtering a list on the main page and it worked. But now, the form in the modal is clear each time and I don’t create this action. I don’t understand … I think there is something change in Adalo …
Thanks.

Hi @sKuD,

Sorry, but I’m not sure I understand completely what would you like to do.
Do you want to create a hidden input, which is not visible to a user? Then you need to follow my advice above.
Do you want to hide input (make it invisible) after some user actions? Then make it “Sometimes Visible”, and set the conditions when would you like to show it or hide it. One of possible solutions could be:

  • create a True/False property in “Users” collection, call it “InputIsVisible”
  • Make Input sometimes visible when InputIsVisible=True
  • on the action leading to the screen with this input, “initialise” this property (Update → Logged-in User → InputIsVisible=True)
  • when you need to hide the input, for example, by pressing a button, put the very last action: Update → Logged-in User → InputIsVisible=False.

You can read more about conditional visibility here: Glossary - Adalo Resources and here Changing Component Visibility - Adalo Resources

Best regards, Victor.

Hi @Victor , thanks for your answer.

  • create a True/False property in “Users” collection, call it “InputIsVisible”
  • Make Input sometimes visible when InputIsVisible=True
  • on the action leading to the screen with this input, “initialise” this property (Update → Logged-in User → InputIsVisible=True)
  • when you need to hide the input, for example, by pressing a button, put the very last action: Update → Logged-in User → InputIsVisible=False.

I did this first, and the problem is : when user hide the form, the form is cleared; so I can’t keep value to filter my list.

Hi @sKuD,

Ok, I understand the issue now. As I understood your requirements:

  • list is displayed to a user
  • user filters the list by entering value in Input
  • list is filtered dynamically (results are displayed)
  • user presses a button
  • input must disappear AND list should remain filtered.

With this strict requirements, I can’t imagine a direct solution to the problem, unfortunately :(. Though couple of workarounds might be useful:

  • have 2 lists on the screen, make them conditionally visible (say, using True/False property in Users collection, call it “ButtonPressed”). The first list should be visible when ButtonPressed is False - this is where search results are displayed, it is filtered by Input.
    Then, after button is pressed, you copy the value from the Input to another input (transparent) or into the DB (you can create additional property, call it “FilterValue” to store the value in Users collection).
    Then you update ButtonPressed to True → second list is displayed. And second list should be filtered by another input or value from Logged-in User → FilterValue.
  • Another possible workaround could be storing the value from the input to the database, and filter the list by this value. See here, for example - Is it possible to Autosave input? - #3 by Victor (you can use autosaved input value to filter the list). Or you can use component by @Michael: 🐒 Autosave Text Input | New Component from NoCode Monkey

Hope this helps.

Best regards, Victor.

It’s what I want to do.

Thanks for the tricks.
I thought using database, but if I have many fields, it’s just a bad idea.

Thanks :wink:

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.