# Get Button Index

**URL:** <https://forums.unrealengine.com/t/get-button-index/490410>\
**Category:** UI\
**Tags:** button, child-actors, index, unreal-engine, Array, UI, question\
**Created:** [October 29, 2021, 9:00pm UTC](https://forums.unrealengine.com/t/get-button-index/490410 "2021-10-29T21:00:12Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![HELIXHEX6](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@HELIXHEX6](https://forums.unrealengine.com/u/HELIXHEX6)\
**Post date:** [October 29, 2021, 9:00pm UTC](https://forums.unrealengine.com/t/get-button-index/490410/1 "2021-10-29T21:00:12Z")

</div>

Hello guys, does anybody know, how can i get the index of the button, that player clicks on?

More specific to be, I’ve created a system that makes for every row from a data table, a child (a button) in a vertical box.  
Now the player presses, one of that buttons, how can I know which child (index) of that vertical box he clicked?

What I’ve done until now:

 ![351290-news-1.png](https://d3kjluh73b9h9o.cloudfront.net/original/4X/f/1/7/f17ccb6d478c296f891168b86b0f08f92af7d8ab.png)

this is the add button function

 ![351311-news-2.png](https://d3kjluh73b9h9o.cloudfront.net/original/4X/4/5/8/45884031290855cb7db7b046bccc5ee23d26e30a.png)

---

<div class="post-metadata">

**Author:** ![ugmoe](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@ugmoe](https://forums.unrealengine.com/u/ugmoe)\
**Post date:** [October 30, 2021, 12:40am UTC](https://forums.unrealengine.com/t/get-button-index/490410/2 "2021-10-30T00:40:18Z")

</div>

You would have to make an Event Dispatcher with an Input that references your Widget. Then call that Event Dispatcher when the button is pressed and give it a self reference. Then you would bind that Event Dispatcher on the blueprint that created all the widgets. Now, when the button is pressed, you get a reference to the Widget.

I dont know how experienced you are, let me know if you need help with Event Dispatchers

---

<div class="post-metadata">

**Author:** ![HELIXHEX6](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@HELIXHEX6](https://forums.unrealengine.com/u/HELIXHEX6)\
**Post date:** [October 30, 2021, 8:31am UTC](https://forums.unrealengine.com/t/get-button-index/490410/3 "2021-10-30T08:31:28Z")

</div>

Hello, thank you for answering, you are right, i never worked with event dispatchers, can you show me how to work with them with some screenshots, because i’m not pretty sure if i’ve understanded

---

<div class="post-metadata">

**Author:** ![ugmoe](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@ugmoe](https://forums.unrealengine.com/u/ugmoe)\
**Post date:** [October 30, 2021, 2:13pm UTC](https://forums.unrealengine.com/t/get-button-index/490410/4 "2021-10-30T14:13:20Z")

</div>

here is a good tutorial, if you need help on a particular part, just let me know exactly what you need help with

[![](https://d3kjluh73b9h9o.cloudfront.net/original/4X/7/c/f/7cf83d519e266410758194dfccb83d2d58642b1a.jpeg "HTF do I? Event Dispatchers in Unreal Engine 4") ](https://www.youtube.com/watch?v=sEcoWGrF1Hg)

---

<div class="post-metadata">

**Author:** ![DEVxXR](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/devxxr/32/1067984_2.png) [@DEVxXR](https://forums.unrealengine.com/u/DEVxXR)\
**Post date:** [May 31, 2022, 6:52am UTC](https://forums.unrealengine.com/t/get-button-index/490410/5 "2022-05-31T06:52:45Z")

</div>

Hey , have yo complete this ? Did you get the index of the buttons using Event Dispatcher ?  
If so could help me
