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.
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.
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?
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.