Set Custom State is not working on next item of repeating group

I have a repeating group named Meal and when I move to the next item on the RG I want to update the state of a reusable element named Alcohol Icon with the data of the item in the RG. Currently for some reason, the state gets updated with the data from the previous item instead of the current item.

Can someone help me figure this out. I 've been trying to solve this for 2 days and its driving me nuts.

https://bubble.io/page?type=page&name=meal_composition_input_no&id=garam-towon-33279&tab=tabs-1

Don’t use the custom state…use the new feature of Property on the Reusable…with the Property feature you can set a default value dynamically which you can not do with customs states. Then when you place your reusable into the repeating group the property value will automatically be updated based on the data entry value in the repeating group cell.

1 Like

Sorry I am not familiar with adding properties and looked aroung the internet but not much info on this feautre.

Does writing to property require making changes to the db?
If that is the case, might as well make the change straight into the actual element. I am using states so that i can save 8 db changes for one…

Sidenote : I tried adding a property to the RE but I do not know how to change that property… Do I make changes to a thing?

No

It worked. Thank you.

Can you tell me why custom states wouldn’t work so that I can have a better understanding of the logic?

Custom states can only be set via a workflow action, and we are not able to set a dynamic default value for them. On the other hand, the properties can have a dynamic default value and will not require a workflow action to set that value.

Additionally, when working with a repeating group, although in the editor, we build only a single cell and place into it one reusable element, once the page is rendered for the user and the repeating group has multiple results, and therefore multiple cells, there are actually multiple instances of the reusable element, each one separate from each other. We also can not (at least not without use of a plugin) run actions inside of each repeating group cell from outside of the repeating group, so setting the custom state of the reusable element would require you to trigger the workflow to set the custom state in each cell of the repeating group which would require the use of a plugin.

1 Like

Understood. Thank you!

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