# How to get row in which button was selected

**URL:** <https://community.weweb.io/t/how-to-get-row-in-which-button-was-selected/8468>\
**Category:** How do I?\
**Created:** [May 5, 2024, 11:35pm UTC](https://community.weweb.io/t/how-to-get-row-in-which-button-was-selected/8468 "2024-05-05T23:35:20Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![jeeven](https://avatars.discourse-cdn.com/v4/letter/j/e5b9ba/32.png) [@jeeven](https://community.weweb.io/u/jeeven)\
**Post date:** [May 5, 2024, 11:35pm UTC](https://community.weweb.io/t/how-to-get-row-in-which-button-was-selected/8468/1 "2024-05-05T23:35:20Z")

</div>

Hi everyone,

I have a datagrid in which I have a button to edit one of the rows in my grid. When the button is clicked a modal pops up. My question is, how can I access either the data in the row or the index of the datagrid which was selected in order to populate the text in the modal.

I’ve attached pictures to show what my flow is.

 ![imgonline-com-ua-twotoone-gHUvNmrRVQ](https://us1.discourse-cdn.com/flex016/uploads/weweb/original/2X/a/ab7af21d197aefa4b825fb979242da64dd9067ec.jpeg)

I’d like to populate this modal with information from the datagrid.

Thanks everyone for your help.

---

<div class="post-metadata">

**Author:** ![luka](https://sea2.discourse-cdn.com/flex016/user_avatar/community.weweb.io/luka/32/1571_2.png) [@luka](https://community.weweb.io/u/luka)\
**Post date:** [May 6, 2024, 8:51am UTC](https://community.weweb.io/t/how-to-get-row-in-which-button-was-selected/8468/2 "2024-05-06T08:51:38Z")

</div>

You have the `item.data` exposed on the button with the row data. You can use a `Change variable value` to put this object into a variable and then use it in your modal.

---

<div class="post-metadata">

**Author:** ![Lee.B](https://sea2.discourse-cdn.com/flex016/user_avatar/community.weweb.io/lee.b/32/14973_2.png) [@Lee.B](https://community.weweb.io/u/Lee.B)\
**Post date:** [August 27, 2025, 12:34am UTC](https://community.weweb.io/t/how-to-get-row-in-which-button-was-selected/8468/3 "2025-08-27T00:34:39Z")

</div>

Has this functionality changed with the new datagrid? It doesn’t seem to expose item.data anymore

---

<div class="post-metadata">

**Author:** ![Himanshu](https://sea2.discourse-cdn.com/flex016/user_avatar/community.weweb.io/himanshu/32/16305_2.png) [@Himanshu](https://community.weweb.io/u/Himanshu)\
**Post date:** [August 29, 2025, 1:16pm UTC](https://community.weweb.io/t/how-to-get-row-in-which-button-was-selected/8468/4 "2025-08-29T13:16:06Z")

</div>

It’s `Event.row` now

 ![Screenshot 2025-08-29 at 6.45.56 PM](https://us1.discourse-cdn.com/flex016/uploads/weweb/original/2X/4/434c20a33c82718daad8a07ea624206a8f1e87dc.png)

---

<div class="post-metadata">

**Author:** ![Lee.B](https://sea2.discourse-cdn.com/flex016/user_avatar/community.weweb.io/lee.b/32/14973_2.png) [@Lee.B](https://community.weweb.io/u/Lee.B)\
**Post date:** [August 31, 2025, 4:12am UTC](https://community.weweb.io/t/how-to-get-row-in-which-button-was-selected/8468/5 "2025-08-31T04:12:16Z")

</div>

Thanks @Himanshu 🙂
