Very basic custom-state question

​I know this is very basic but something isn’t clicking for me with custom states. Any chance someone could tell the problem with the custom state in the example below?

https://bubble.io/page?name=index&id=custom-state-13032022&tab=tabs-6&subtab=General

Here is what you will see on the (fully editable) link above;

Your workflow should set the value from the input box. You have set it to read the group A’s value (which has not been set yet).

image

Thanks @mmahirf, so easy when you point it out!

I do find some elements of custom-states a bit odd. For example, I added a custom state, let’s call it ‘XYZ’ to a page ‘homepage’, then referred to Parent groups XYZ. This doesn’t work, I had to refer to homepage XYZ. I felt that both options should work? Not a big deal but took me a long time to realise the mistake!

You’ve probably named your state as the same name your data is…
So “Parent’s group XYZ” you are linking to the data you have set to the group (data source)
and when you put Homepage, the state option appears, so you can either reference to the state or the data source, so be careful (the data source will be the first option, the state will be the last)

No, I think it is an anomaly of Bubble because selecting Parent Group won’t show custom states, but if you type the name of the group it will then show the states.

Here’s an example, the custom state temp_stored_data is stored on the group create-invoice . Bubble allows you to refer to the custom state ONLY when you first type the group/page name, in this case create-invoice .

However, if you try and search with the Parent Group, it won’t find the custom state. Like I said, this is not a problem but I wish it was made clearer!

This is how bubble has set up their platform. A good one at that. Had they allowed parent groups custom state to be a thing it would be confusing if one had multiple custom states in (various) elements.
This way it’s clean and allows the dev to identify which element holds the custom state.

1 Like

I am sure you are right, although I don’t quite see the issue because if I had multiple custom states on the group/page I would just refer to the Parent group's [name of custom state]. This would be as clean as referring to page name [name of custom state].