Clear a repeating group on page load

Hey there! I have a repeating group that gets data from an API call. It saves all the data on the same page and doesn’t clear it when the page is refreshed. Can you please help me figure out, how to clear the data from a repeating group when the page is refreshed.

I tried to use clear the list, reset the list, reset the group workflows, but the list is still there when I refresh the page.
I haven’t created a custom state, I may not understand the concept of custom states too well, but I need all the data to be stored in my database, so I am not sure if custom states will solve my problem.

Will deeply appreciate some help here!

Clear it to what?

Clear it so that the user didn’t see the history of his interaction in the chat (RG = chat history). So that each time they refreshed they page it was like a start over.

well then, just make sure its initial datasource is empty…

or use a field on the datatype to filter out old messages (such as the created date)

1 Like

Adam thank you so much! I think I understand the second option (if I get it right I can also create custom field in order to filter out history) but can you elaborate just a little bit on using empty data source? Do I need to create it elsewhere?

option 1: start with an empty datasource, and just add things to it as they are created (that won’t work with a chat feature though… so if that’s what you’re doing then option 2 will be best).

option 2: Just set a custom state (Date) on page load, and add a constraint to your RG datasource to only show things (messages) created more recently than that.

1 Like

Thank you so much! I will try this out and share the progress

1 Like

Hi! So I did use custom states after all. I followed the tutorial and created several conversations. That allows batching messages in conversations and show on a page only those that are in conversations.
Here is part 1 of a video, I got the most answer in part 2: https://www.youtube.com/watch?v=D6cwirERrtg