Hello Bubble forum,
I am building a chatbot application with two parts: a group that displays messages (which are shown in a repeating group inside the main group), and a group with a text field for composing a message and a send button.
My goal is to change the state of the message element when the user clicks the send button. However, I have encountered an issue where the elements inside the repeating group are not available dropdown when I attempt to do this using a workflow.
The general app structure looks like this:
I would appreciate any insights or solutions to this problem. Thank you in advance for your help.
Hi Faheem. You cannot look ‘inside’ a repeating group. The only solution is to pass information using custom states. You can create a custom state in the RG and use the workflow to pass information to it. Then use the elements inside the RG to pickup the information from the custom state.
I like to work the other way around. As @kwame said, you can’t look inside an RG as the group/item won’t exist until it’s populated with data. I have stored data in Custom States outside of the RG, as suggested above (think outside the box!!!). You’d need to have a reset, set “” to ensure that if the data in the RG changes, the data in the Custom State will also change.
Dear @kwame and @philip2 ,
Thank you for your responses to my question. Your suggestions for using custom states to update elements within the repeating group were very helpful.
However, I have one additional requirement that I hope you can help me with. I only want the latest message element to be affected by the custom state. The other messages should not be affected.
Is there a way to accomplish this using custom states, or is there another solution you can recommend?
Thank you for your help and advice.
Is it a visual change that you want only for the last item? I’ve used ‘Cell Index’ values in Conditional before.
Current Cell’s Index is 1 - Make it Blue… or something.
If it’s the last number then you could count the list in the rg and then if the current cell index = count of RG then make it Blue… or something!
I wanted to thank you both for your helpful responses to my question about my app. Thanks to your suggestions and insights, I was able to find a solution to the issue.
Special thanks to @philip2 for answering more in-depth questions.
Your contributions were truly priceless, and I appreciate your willingness to help.
You’re welcome @Mhd_Faheem. This forum has saved my (app) life a few times, so happy to return the favour
The power of this community cannot be measured in WUs!
Pass on any help you can in the future!
This topic was automatically closed after 70 days. New replies are no longer allowed.