How do I get the ID of a dynamically created button?

Question: How do I get the ID of a dynamically created button to look-up in an array?

Details: I have an array called “MyCharacterSkills”, which is generated from a base array of skills available for that character archetype. I then determine how many skills in the array are of the ID assigned to “Skill of your Choice”.

In UMG, I have a main UI widget named CharacterSheet which contains an Overlay > Scroll box > Vertical Box. I have a second widget called SelectableSkills that just contains a Button and child Text which changes based on the name associated with the Skill ID passed into the widget’s text variable.

A ForEachLoop creates one button (and text) per skill, giving me a list of skills to choose from, with IDs of (for instance) 200 to 235 within the vertical box. Inside the ForeEachLoop, I assign the Skill ID from the array element to the button via the “Skill Button ID” varialbe, and using an “OnClicked” event within the button widget, I can PrintString and verify the ID is properly set to the button.

I don’t know how to get the ID of the button the user clicks back to the CharacterSheet blueprint, which I will then use to reassign that skill ID back to the user’s “My Skills” array.

Hey , I’m currently doing same kinda work but I’m getting array or string from was cloud and I want to assign it to button .For ex, I have 4 array of strings and I’m able to create the 4 dynamic buttons at runtime for 4 arrays.But how can we assign those arrays to there respective buttons ?

Where do you need the ID of the Button?
Create a custom event there and set an input like buttonid. At the button click instead of string debugging cast to for example controller and handle the logic there or string debug it at first.