# Create Popup: Get Value of the Menu Item Clicked On

**URL:** <https://forum.inductiveautomation.com/t/create-popup-get-value-of-the-menu-item-clicked-on/56585>\
**Category:** Ignition\
**Created:** [February 25, 2022, 8:17pm UTC](https://forum.inductiveautomation.com/t/create-popup-get-value-of-the-menu-item-clicked-on/56585 "2022-02-25T20:17:03Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![dkhayes117](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/dkhayes117/32/68344_2.png) [@dkhayes117](https://forum.inductiveautomation.com/u/dkhayes117)\
**Post date:** [February 25, 2022, 8:17pm UTC](https://forum.inductiveautomation.com/t/create-popup-get-value-of-the-menu-item-clicked-on/56585/1 "2022-02-25T20:17:03Z")

</div>

I oddly couldn’t find anywhere that shows how to get the value of the popup menu item that is ultimately clicked on. All of my menu items will call the exact same function and will set a window property to the value that was clicked on.

---

<div class="post-metadata">

**Author:** ![paul-griffith](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/paul-griffith/32/37249_2.png) [@paul-griffith](https://forum.inductiveautomation.com/u/paul-griffith)\
**Post date:** [February 25, 2022, 10:00pm UTC](https://forum.inductiveautomation.com/t/create-popup-get-value-of-the-menu-item-clicked-on/56585/2 "2022-02-25T22:00:38Z")

</div>

I’m assuming, but is this Vision?

If so, when constructing your methods, you can take advantage of first-class functions via `functools.partial`:

```auto
from functools import partial

def saySomething(event, message):
   system.gui.messageBox(message)

messages = [
   "hello",
   "goodbye"
]

menu = system.gui.createPopupMenu(
   ["Say %s" % message for message in messages],
   [partial(saySomething, message=message) for message in messages]
)
menu.show(event)

```
