Custom State Default Value - Dynamic

It would be cool to set a custom state default value dynamic so that we can reference another element on the page that the custom state value is connected to instead of having to use a workflow to set the custom state value

5 Likes

Hey @boston85719 :wave:

Yeah, I agree! This would be nice to have for sure. Maybe submit it here: https://bubble.io/ideaboard

Hope that helps! :blush:

@j805 www.NoCodeMinute.com

For All Your No-Code Education Needs:

  • One-on-One Tutoring
  • eLearning Hub
  • Video Tutorials
  • No-Code Classes
1 Like

Thanks for that link…I didn’t know that existed.

I guess this forum Idea section is not where they look any longer.

2 Likes

No problem. :blush:

Hi,
Was the feature enabled? If not then what’s the way around?

set it on page load

Can you elaborate on this please. Below I’ll explain the exact scenario i have or need.

I want to change the count of travelers or passengers by pressing the plus and minus buttons. The value in the input element ( count of travelers) increases when plus icon is pressed and decreases when minus icon is pressed. The initial content of the input element is mapped to the state with a default value of 1. So basically the plus and minus icon is changing the state value which in turn is changing the input element’s value.
The catch comes here. I’m having 2 navigation paths for a person to reach this page. One path is direct so that’s simple and i can begin with the default value of state and modify with button press work flow.
The second path is from home page. On home page i already ask the user to give the number of passengers and i pass that count of passengers to this page. So now the default value of input element (count of passengers) is not the default value of state but the value given by user on home page.
I’m stuck here. I’m not able to put a condition that when user has already given count of passengers on home page then the initial content of input element becomes that value from home page and that value also changes when plus or minus icon is pressed.

I hope i was able to make sense.

Use
Set it on page load
When condition true = current pages URL is parameter x and send the parameters when he navigates to your page

Should work :slight_smile:

1 Like

Also you could save the inputs from the user to the current user without logging him in so he gets a session id and when he revisits the page with the same cookies it will show his last search :slight_smile:

@buero your solution solved my problem. Thanks so much for taking the time and putting in the effort to help me out. Really appreciate it.

Nice
Mark it as solution the others see what worked here :slight_smile: and this post is getting closed as well

1 Like

This was a thread created to highlight the idea for Bubble to add the feature so that the custom state default value could be set in the editor to a dynamic value without the need of a work around like this. It wasn’t intended to be a question/need help post, although I’m sure @harab.business appreciates you providing him the work around.

1 Like