Ui block onclick event

Hi I’m having trouble with onclick event on a block. This is what I want to do:

I want to add the values of highlighted blocks and append them to the text on the top left. This code only changes the text on the top left and not append each newly selected block to it.

I have tried adding the values to a list each time but the list does not keep the previous values. Am I missing something or is there a specific way to solve this? Any help will be appreciated. Thank you :slight_smile:

Hello @DALDE_John

On the screenshot I do not see any blocks that modify a list, I can see only get/find blocks.
Could you please point me what exactly logic does not work for you

Oh I already deleted the code where I added the values to the list. That code just changes the text to the value of the highlighted block.

alright, how can I help?

Instead of changing the text on the top left to the value of a highlighted block, I want to append each value higlighted to the text so it would form a list. Is there a way to do that? Thank you so much for taking the time to reply. :slight_smile:

yes, you can add a Repeater and then bind it to the list

Will try that. Thank you :slight_smile:

From the code above. How would I go about adding each value to a list and set that list to a property in page data. When I tried this, it would still just get the last highlighted block.

I also tried making an empty list and adding the values there and then setting the list to the property but it would still just get only the last block highlighted. It would seem that it did not keep the previous values in the list.

try to use a Print block to debug how the list looks before/after changing