This is something you’d generally handle with Event Dispatchers.
- create a user widget that represents a scroll box and populates it with buttons from the array
- as you create those user widgets in a loop, assign them IDs; you can do it manually via exposed variables if there’s only a handful and you place them by hand
- register every button’s
onClickin that user widget and have the scrollbox user widget propagate its ID via an Event Dispatcher whose delegate is in the widget that created the scroll boxes
If the above seems confusing, consider looking into what user widgets are, and how to handle them. It’s such a vital element of the UMG, one cannot do anything that is modular without them. And the next thing would be to look into how Event Dispatchers work - these shine when we need to perform an action in one object and observe the result in another. Especially when it’s a parent-child relationship, like in your example.