My custom state will not display after creation

I am currently trying to create a hide and show for my RG. The idea is on page load I will see 4 items from my RG and then on clicking see more the remaining options will show. I found a number of videos online how to do this and it seems simple.

My problem is the first step is to create a create a custom state and assign to the :items Until. But my custom state will not show in the dropdown and I believe I have setup everything up correctly. Does anyone know how to fix this please?

Custom state

Query

1 Like

You have to reference the element first.

Hey @jerneva.cowell

Below, I right some things that can be a problem and how to fix:

The issue described indicates that the user tried to create a Custom State to control the number of visible items in a Repeating Group (RG), but this state is not appearing as an option in the :items Until drop-down menu. This can occur for several reasons. Here are some possible causes and solutions:

  1. Custom State was not created in the correct element
    :small_blue_diamond: Cause: The custom state must be in the same element (or in an accessible parent) to be referenced. If the Custom State was created in another group or element, it may not appear in the :items until dropdown.

:white_check_mark: Solution:

Make sure the Custom State was created in the same group or in an element accessible by the hierarchy.

If it is on the page, use “This Page’s Custom State”.

If it is in a parent group, the Repeating Group must be within that group to access it.


  1. Custom State is not being called correctly
    :small_blue_diamond: Cause: The user may be trying to access the Custom State without properly referencing the element where it was created.

:white_check_mark: Solution:

When setting :items until, manually type “Element Name’s Custom State” to force Bubble to recognize it.

If the state is on the page, use “This Page’s Custom State”.
3. Repeating Group is not updated
:small_blue_diamond: Cause: If the Custom State was created after the Repeating Group was set, Bubble may not have updated the available options.

:white_check_mark: Solution:

Refresh the page or remove and re-add the Repeating Group to ensure Bubble detects the new Custom State.


  1. Custom State not initialized correctly
    :small_blue_diamond: Cause: Bubble does not recognize null values ​​in some cases. If the Custom State does not have an initial value, it may not be detected correctly.

:white_check_mark: Solution:

In the Page Load flow, add a “Set State” action and set the Custom State to 4 (or another initial value). How to Implement the “View More” Function Correctly
:one: Create a Custom State in the RG or in a Container Group

Name: visible_items
Type: Number
Initial Value: 4
:two: Define the Repeating Group Condition

Data Source: Search for Items:items until Parent Group’s visible_items
:three: Add a “View More” Button and Create a Workflow

When the button is clicked, Set State → visible_items = visible_items + 4
:four: Hide the “View More” Button When All Items Are Visible

Button Condition: When visible_items >= Search for Items:count → This element is not visible


The issue is likely related to the Custom State data type, the element hierarchy, or the Bubble refresh.

If you have a question, please send me a message on DM

The Custom state is on the page and This page Custom state does not appear either

Thanks so much for this. I am slowly working through this and will be in contact shortly. Thank you

Then you have to reference the page first (by name), in order to be able to access the custom state.

(ignore the ChatGPT response above - it’s complete nonsense).

1 Like

Try refreshing your editor tab. Sometimes, I can’t reference my custom states, and I often solve this by refreshing my editor. Try doing what @adamhholmes suggests.

@emanuelcastro.tec I have tried everything. Nothing has yet worked. I am on to something else and will update this thread once I have found the solution