# Perspective Table render a view,Button Click sendMessage

**URL:** <https://forum.inductiveautomation.com/t/perspective-table-render-a-view-button-click-sendmessage/87167>\
**Category:** Ignition\
**Tags:** perspective\
**Created:** [March 12, 2024, 6:56am UTC](https://forum.inductiveautomation.com/t/perspective-table-render-a-view-button-click-sendmessage/87167 "2024-03-12T06:56:00Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![taohongyu88](https://avatars.discourse-cdn.com/v4/letter/t/f05b48/32.png) [@taohongyu88](https://forum.inductiveautomation.com/u/taohongyu88)\
**Post date:** [March 12, 2024, 6:56am UTC](https://forum.inductiveautomation.com/t/perspective-table-render-a-view-button-click-sendmessage/87167/1 "2024-03-12T06:56:00Z")

</div>

I render a column to a view.  
In the view , I add a button.

 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/4/e/4e9c09a3daba2bfe18f64561e9acabf31ae58562.png)

In the button , I want to click to sendmessage to do sth.  
But I find when I click it ,send all rows message?

 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/1/6/1606ad4fc347ba148e63105f1e7e5e767ed877aa.png)

```auto
def messageBox(title,message):
	system.perspective.openPopup("messageBox",'Poup/messageBox', title=title,params = {'message':message}, showCloseIcon = True, resizable = True,modal=True)

```

 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/f/4/f401a46b000bfb6cb1839ef0c0dddb5f9afc8cf9.png)

 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/c/7/c76d2542869ce851b1c6ded45c3b8dee531d418e.png)

 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/0/d/0d1d86ccb55b7580654eac28dc8836a0c3db656a.png)

---

<div class="post-metadata">

**Author:** ![YF129701](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/yf129701/32/60498_2.png) [@YF129701](https://forum.inductiveautomation.com/u/YF129701)\
**Post date:** [March 12, 2024, 3:01pm UTC](https://forum.inductiveautomation.com/t/perspective-table-render-a-view-button-click-sendmessage/87167/2 "2024-03-12T15:01:54Z")

</div>

You're not actually using your `id` that you are retrieving from `rowData`. So you send one message, but on the receiving end, every button receives it and that's why you get 4 confirm messages. You need to filter on the `id` somehow

Inside of the `infoConfirm` message handler, add a check to make sure that the `id` you pass in from your button click matches the row's ID and only then print. I'm assuming your script is going to do something more than just print a statement.

Something like

```python
id = payload["id"] # of course, first pass the id in the payload to receive it

if id == self.view.params.rowData["id"]:
    system.perspective.print("received message for id: {}".format(id))

```

should help you filter out to only receive one message.
