Do a search for with custom states values

Hello,

I’m trying to do a search for something when the user clicks on a button : it has to search for something depending on the choices of the user.

On my page, the user can choose different options, each one is stored inside custom states.
So when he clicks I need to do something like :

SELECT FROM mytable WHERE col1 = custom_state_1 AND col2 = custom_state_2

Then I need to store it inside another custom state.
Is it possible ?

When I try to set the custom state to the result of the “do a search for”, the problem is I can’t add any custom state in the constraint.

Does is mean I’ll have to store the user answer inside the user table for example ? Because I saw that I can insert user related fields in the constraint ?

This post could be helpful

Hello @boston85719 and thanks you for taking the time to answer.

However I couldn’t find any answer…
It seems that I’m doing the same thing as explained in the post : I save user’s choices inside custom states. And then I’d like to build constraints based on these custom states.

However, when I want to create the constraints, I’m not able to select custom states, they don’t appear in the list.

Here’s what I did for now :

Here it is stating. I’d like to replace these static values with custom states values but I don’t know how.

When I want to choose my custom state for the constraint, here’s what I have :

As you can see, there’s no possibility to choose a custom state…

Could you please help me ?

Thanks

When you create the custom state you are creating it on an element.

Your page is considered an element, as is an image, icon, text etc. So, which ever element you place the custom state on, you need to reference that element in your dynamic expression to begin. Once you have selected the element, you would continue the dynamic expression by selecting the custom state on the element you want to reference.

For example, if I put the custom state onto my page and my page name is Index then I would start the dynamic expression by selecting the Index from the list of choices.

In your screen shot, it doesn’t look like there are any elements on your page, so I am assuming you placed the custom state on the page itself, so whatever that page name is, you would choose that from the list of options you outlined in red.

Yes @boston85719 I know that you have to reference the page when you want to call a custom state.
In my case I need to get add_vent’s firstAnswer, add_event’s second Answer and add_evnt’s thirdAnswer.
However these values are NOT present in the list that I outlined.
And I don’t understand why…

image

On the previous image that I uploaded you can see all the options that I can choose, and the page name is not even there…

Yes, in your screen shot before, there are no elements, not even the page…are you attempting to create the dynamic expression that requires the custom state value from the same page you created it on?

If you have and you are not seeing any elements on the page itself in the list and not seeing the page itself in the list then I would report a Bug to Bubble support.

If it is, then it is likely the fact that the custom state data type is set to Text but the values you are trying to set in your workflow for second answer, third answer and first answer are not Text and look like they are supposed to be YES/NO data type…whatever type of data you are trying to save for the field needs the custom state to be of the same type for it to show up as an option to select.

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