# Example needed for context menu

**URL:** <https://discourse.nodered.org/t/example-needed-for-context-menu/66319>\
**Category:** Dashboard\
**Created:** [11 August 2022 11:31 UTC](https://discourse.nodered.org/t/example-needed-for-context-menu/66319 "2022-08-11T11:31:56Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![kvramji](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/kvramji/32/59005_2.png) [@kvramji](https://discourse.nodered.org/u/kvramji)\
**Post date:** [11 August 2022 11:31 UTC](https://discourse.nodered.org/t/example-needed-for-context-menu/66319/1 "2022-08-11T11:31:56Z")

</div>

I just started playing with the SVG nodes and context menu.  
I would like to know if there is anyway i can fill the label field in the following image to display something i pass from another node.

 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/2/2/22abbd8a4fe513611cd18deffffd7a37ea838a44.png)

Sadly, this is what i am getting.  
 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/1/f/1f017946a5087429567a7f930a40a5cdb2f000c6.png)

Can someone help me with displaying a custom label from another node??

---

<div class="post-metadata">

**Author:** ![Steve-Mcl](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/steve-mcl/32/4826_2.png) [@Steve-Mcl](https://discourse.nodered.org/u/Steve-Mcl)\
**Post date:** [11 August 2022 11:47 UTC](https://discourse.nodered.org/t/example-needed-for-context-menu/66319/2 "2022-08-11T11:47:29Z")

</div>

checkout the readme, built in help and the built in examples (`CTRL-I`) - it shows you how to generate dynamic entries

---

<div class="post-metadata">

**Author:** ![kvramji](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/kvramji/32/59005_2.png) [@kvramji](https://discourse.nodered.org/u/kvramji)\
**Post date:** [11 August 2022 13:35 UTC](https://discourse.nodered.org/t/example-needed-for-context-menu/66319/3 "2022-08-11T13:35:27Z")

</div>

I have gone through it but i get this error

![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/f/d/fd21b653c9d4a99459ef89e8d342b73158566ec7.png)

It looks like i am doing something wrong ☹

---

<div class="post-metadata">

**Author:** ![Steve-Mcl](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/steve-mcl/32/4826_2.png) [@Steve-Mcl](https://discourse.nodered.org/u/Steve-Mcl)\
**Post date:** [11 August 2022 14:49 UTC](https://discourse.nodered.org/t/example-needed-for-context-menu/66319/4 "2022-08-11T14:49:22Z")

</div>

is that a function node? a template mode? Which example did you try?

---

<div class="post-metadata">

**Author:** ![kvramji](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/kvramji/32/59005_2.png) [@kvramji](https://discourse.nodered.org/u/kvramji)\
**Post date:** [16 August 2022 16:10 UTC](https://discourse.nodered.org/t/example-needed-for-context-menu/66319/5 "2022-08-16T16:10:04Z")

</div>

Sorry for the delay. I would like to have the programmed with a function node.

I am not sure how to address that label in the contextmenu (from a function node) as shown in the last image on the original post ☹

---

<div class="post-metadata">

**Author:** ![Steve-Mcl](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/steve-mcl/32/4826_2.png) [@Steve-Mcl](https://discourse.nodered.org/u/Steve-Mcl)\
**Post date:** [16 August 2022 16:19 UTC](https://discourse.nodered.org/t/example-needed-for-context-menu/66319/6 "2022-08-16T16:19:59Z")

</div>

I asked if it was a function node because you have simply put an array in it with without doing anything with it.

Try this in your function node...

```javascript
msg.menu = [
    {
        "text": msg.payload[0].ParkingSlot,
        "icon": "fa-car",
        "enabled": true,
        "topic": "ParkingSlot",
        "payload": msg.payload[0].ParkingSlot,
        "payloadType": "str"
    },
    {
        "text": msg.payload[0].CarNoPlate,
        "icon": "fa-text-width",
        "enabled": true,
        "topic": "CarNoPlate",
        "payload": msg.payload[0].CarNoPlate,
        "payloadType": "str"
    },
]
return msg;

```

Connect as follows...  
`your data payload --> function node --> menu node`

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/1X/d073cd938eafa2e558d7c2cd59003b3ef4963033.png) [@system](https://discourse.nodered.org/u/system)\
**Post date:** [15 September 2022 16:20 UTC](https://discourse.nodered.org/t/example-needed-for-context-menu/66319/7 "2022-09-15T16:20:27Z")

</div>

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.
