How can I add items on list view without repeating?

I want to add key names into listview without repeating. When I press the button to show the keys I have, I don’t want same keys to repeat. I know it’s about adding list for each loop when every time I pressed the button but I can’t think other option to do it. Here is my blueprint and the issue, how can I fix it?



you could include various steps, before adding the item check if is already in the list, if it is don’t add it.

or… if your items are in an array before adding them to the list, use “AddUnique” instead of the normal add.
And make sure to clear the lists children before repopulating it.

Use a Set of Enums instead of an array:

Mainly because I never see anyone use it :innocent:

1 Like

Unfortunately, array items were already added with “addunique”. Sorry for the late response.

I’m %90 sure that the problem is not with array issues. Array contains key ids in the array data. When I want to add to list widget it’s writing below the last data.
It’s like
1: When I have no key when I press the button, nothing appears = that’s normal
2: When I pickup the first key it says key1 which is normal
3: But when I pickup the second key it says key1 key1 key2. It’s not updating the list, its writing the array items below it.

Thanks for the advice tho. I’ll consider to use sets.


This is the “Add Object To List” Fuction

and where is the foreavh loop, that iterates the array?

Made sure that you used

ListViewWidget -> Clear Children

befire iterating iver the array and populating the list again.