# Creating one popup to use it with several UDT tags instances

**URL:** <https://forum.inductiveautomation.com/t/creating-one-popup-to-use-it-with-several-udt-tags-instances/97802>\
**Category:** Ignition\
**Tags:** ignition81, perspective\
**Created:** [October 26, 2024, 11:46am UTC](https://forum.inductiveautomation.com/t/creating-one-popup-to-use-it-with-several-udt-tags-instances/97802 "2024-10-26T11:46:00Z")\
**Posts on this page:** 18\
**Page:** 1

<div class="post-metadata">

**Author:** ![Ahmed\_badawi1](https://avatars.discourse-cdn.com/v4/letter/a/58f4c7/32.png) [@Ahmed\_badawi1](https://forum.inductiveautomation.com/u/Ahmed_badawi1)\
**Post date:** [October 26, 2024, 11:46am UTC](https://forum.inductiveautomation.com/t/creating-one-popup-to-use-it-with-several-udt-tags-instances/97802/1 "2024-10-26T11:46:00Z")

</div>

I have 10 UDT instances (tank1/tank2/tank3/....etc) of UDT called "tank" and I want to create just one popup instead of ten and use it with the 10 tanks in perspective, i could do it in vision but not in perspective

---

<div class="post-metadata">

**Author:** ![jlandwerlen](https://avatars.discourse-cdn.com/v4/letter/j/bc8723/32.png) [@jlandwerlen](https://forum.inductiveautomation.com/u/jlandwerlen)\
**Post date:** [October 26, 2024, 2:04pm UTC](https://forum.inductiveautomation.com/t/creating-one-popup-to-use-it-with-several-udt-tags-instances/97802/2 "2024-10-26T14:04:09Z")

</div>

The process isn't much different between the two. This doc might be helpful, [Popup Views | Ignition User Manual](https://www.docs.inductiveautomation.com/docs/8.1/ignition-modules/perspective/views-in-perspective/popup-views#configuring-a-parameterized-popup-view).

The idea, create a view (popup) and add params "tagPath" (this is what I usually call it - you can call it whatever you want). Then add a component in the view. Use an indirect tag binding using the param "tagPath". When you open the popup you simply reference the appropriate parameter. This doc shows how to call the popup, [system.perspective.openPopup | Ignition User Manual](https://www.docs.inductiveautomation.com/docs/8.1/appendix/scripting-functions/system-perspective/system-perspective-openPopup)

---

<div class="post-metadata">

**Author:** ![Ahmed\_badawi1](https://avatars.discourse-cdn.com/v4/letter/a/58f4c7/32.png) [@Ahmed\_badawi1](https://forum.inductiveautomation.com/u/Ahmed_badawi1)\
**Post date:** [October 28, 2024, 11:13am UTC](https://forum.inductiveautomation.com/t/creating-one-popup-to-use-it-with-several-udt-tags-instances/97802/3 "2024-10-28T11:13:18Z")

</div>

yes, i did it but there is still a small problem, data is moved from UDT instance to popup only on button trigger, i want to move values constantly

---

<div class="post-metadata">

**Author:** ![jlandwerlen](https://avatars.discourse-cdn.com/v4/letter/j/bc8723/32.png) [@jlandwerlen](https://forum.inductiveautomation.com/u/jlandwerlen)\
**Post date:** [October 28, 2024, 11:30am UTC](https://forum.inductiveautomation.com/t/creating-one-popup-to-use-it-with-several-udt-tags-instances/97802/4 "2024-10-28T11:30:01Z")

</div>

Show your bindings. If you used an indirect tag binding the values will continually update.

---

<div class="post-metadata">

**Author:** ![Ahmed\_badawi1](https://avatars.discourse-cdn.com/v4/letter/a/58f4c7/32.png) [@Ahmed\_badawi1](https://forum.inductiveautomation.com/u/Ahmed_badawi1)\
**Post date:** [October 29, 2024, 11:25am UTC](https://forum.inductiveautomation.com/t/creating-one-popup-to-use-it-with-several-udt-tags-instances/97802/5 "2024-10-29T11:25:34Z")

</div>

i have a problem in referencing a value to popup param

---

<div class="post-metadata">

**Author:** ![Samuel\_Sueur](https://avatars.discourse-cdn.com/v4/letter/s/e36b37/32.png) [@Samuel\_Sueur](https://forum.inductiveautomation.com/u/Samuel_Sueur)\
**Post date:** [October 29, 2024, 11:30am UTC](https://forum.inductiveautomation.com/t/creating-one-popup-to-use-it-with-several-udt-tags-instances/97802/6 "2024-10-29T11:30:41Z")

</div>

Without code snippets, screenshots of your bindings, etc. we won't be able to help much.

---

<div class="post-metadata">

**Author:** ![Ahmed\_badawi1](https://avatars.discourse-cdn.com/v4/letter/a/58f4c7/32.png) [@Ahmed\_badawi1](https://forum.inductiveautomation.com/u/Ahmed_badawi1)\
**Post date:** [October 29, 2024, 11:46am UTC](https://forum.inductiveautomation.com/t/creating-one-popup-to-use-it-with-several-udt-tags-instances/97802/7 "2024-10-29T11:46:36Z")

</div>

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

this is the binding of popup PARAM

---

<div class="post-metadata">

**Author:** ![Ahmed\_badawi1](https://avatars.discourse-cdn.com/v4/letter/a/58f4c7/32.png) [@Ahmed\_badawi1](https://forum.inductiveautomation.com/u/Ahmed_badawi1)\
**Post date:** [October 29, 2024, 11:48am UTC](https://forum.inductiveautomation.com/t/creating-one-popup-to-use-it-with-several-udt-tags-instances/97802/8 "2024-10-29T11:48:38Z")

</div>

![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/b/f/bfacd52f4a953052185606b366f5a55930674205.png)  
this is the session tag of indirect tag binding

---

<div class="post-metadata">

**Author:** ![Ahmed\_badawi1](https://avatars.discourse-cdn.com/v4/letter/a/58f4c7/32.png) [@Ahmed\_badawi1](https://forum.inductiveautomation.com/u/Ahmed_badawi1)\
**Post date:** [October 29, 2024, 11:52am UTC](https://forum.inductiveautomation.com/t/creating-one-popup-to-use-it-with-several-udt-tags-instances/97802/9 "2024-10-29T11:52:19Z")

</div>

i want to open the popup of two udt instances using two buttons

---

<div class="post-metadata">

**Author:** ![Samuel\_Sueur](https://avatars.discourse-cdn.com/v4/letter/s/e36b37/32.png) [@Samuel\_Sueur](https://forum.inductiveautomation.com/u/Samuel_Sueur)\
**Post date:** [October 29, 2024, 11:52am UTC](https://forum.inductiveautomation.com/t/creating-one-popup-to-use-it-with-several-udt-tags-instances/97802/10 "2024-10-29T11:52:20Z")

</div>

Hum, this is weird.

Is this "POPUP\_UDT" param in the output direction ?

What are you trying to do ? Specify the params in the "POPUP\_NUM" ?

I would move your "POPUP\_UDT" binding into the "custom property" section of the view.  
Then, in the params section, I would add a param "POPUP\_NUM" and just use it in the indirect tag binding I suggested you to move.  
The "POPUP\_NUM" param would then be referenced like this in your binding: `{view.params.POPUP_NUM}`.

When opening your popup, you just have to specify the value of your param "POPUP\_NUM".

~~If you want to keep things how they are at the minute, I would still move your "POPUP\_UDT" in the custom section of your view.  
Then if you really want to use your "session custom" POPUP\_NUM, have a script somewhere that sets this value as you open the popup.~~

EDIT: I've just seen your last message.

If you want to open TWO popups, the ONLY way to do this is with what I've described above.

If you keep using the "session custom" property, both popups will change according to this value as it is "global" to your session.

EDIT again:  
Another way to do it would be to specify the path to your tank instance in your view params instead of just the tank number. This will be much more flexible in the future if you change the name of your tanks, etc.

---

<div class="post-metadata">

**Author:** ![jlandwerlen](https://avatars.discourse-cdn.com/v4/letter/j/bc8723/32.png) [@jlandwerlen](https://forum.inductiveautomation.com/u/jlandwerlen)\
**Post date:** [October 29, 2024, 12:06pm UTC](https://forum.inductiveautomation.com/t/creating-one-popup-to-use-it-with-several-udt-tags-instances/97802/11 "2024-10-29T12:06:47Z")

</div>

To open multiple the IDs need to be unique, otherwise only one will open.

---

<div class="post-metadata">

**Author:** ![Ahmed\_badawi1](https://avatars.discourse-cdn.com/v4/letter/a/58f4c7/32.png) [@Ahmed\_badawi1](https://forum.inductiveautomation.com/u/Ahmed_badawi1)\
**Post date:** [October 29, 2024, 12:10pm UTC](https://forum.inductiveautomation.com/t/creating-one-popup-to-use-it-with-several-udt-tags-instances/97802/12 "2024-10-29T12:10:43Z")

</div>

maybe i have some conflict between custom properties and params, please can you give me steps to make more than instance of popup open at the same time using buttons

---

<div class="post-metadata">

**Author:** ![Samuel\_Sueur](https://avatars.discourse-cdn.com/v4/letter/s/e36b37/32.png) [@Samuel\_Sueur](https://forum.inductiveautomation.com/u/Samuel_Sueur)\
**Post date:** [October 29, 2024, 12:56pm UTC](https://forum.inductiveautomation.com/t/creating-one-popup-to-use-it-with-several-udt-tags-instances/97802/13 "2024-10-29T12:56:09Z")

</div>

@jlandwerlen is right, you need different IDs if you want to open the same popup twice.

If you are using the standard, non-scripted, way of opening a popup, just bind the "identifier" to something dynamic for instance.

 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/5/a/5ab9df499a84f7e729f979cdd06d4fffae62925c.png)

Else, use the scripting function `system.perspective.openPopup` and provide a dynamic ID to your function.

> **[system.perspective.openPopup | Ignition User Manual](https://www.docs.inductiveautomation.com/docs/8.1/appendix/scripting-functions/system-perspective/system-perspective-openPopup)**
>
> Open a popup view over the given page.

---

<div class="post-metadata">

**Author:** ![jlandwerlen](https://avatars.discourse-cdn.com/v4/letter/j/bc8723/32.png) [@jlandwerlen](https://forum.inductiveautomation.com/u/jlandwerlen)\
**Post date:** [October 29, 2024, 1:14pm UTC](https://forum.inductiveautomation.com/t/creating-one-popup-to-use-it-with-several-udt-tags-instances/97802/14 "2024-10-29T13:14:50Z")

</div>

I usually use the path as the ID since these will be unique.

---

<div class="post-metadata">

**Author:** ![pascal.fragnoud](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/pascal.fragnoud/32/24728_2.png) [@pascal.fragnoud](https://forum.inductiveautomation.com/u/pascal.fragnoud)\
**Post date:** [October 29, 2024, 1:16pm UTC](https://forum.inductiveautomation.com/t/creating-one-popup-to-use-it-with-several-udt-tags-instances/97802/15 "2024-10-29T13:16:19Z")

</div>

Please don't do this. Do NOT use session customs to pass parameters. This is HIGHLY unmaintainable, and also WILL (not might, it WILL) bring problems when you open a second tab on the same session.  
Also, what's the binding on the popup's params ?

Here's what you're supposed to do:  
Make your popup take a tag path as parameter. Not a UDT, not the tag's data: Its path and its path only.  
When you open the popup, pass it the path of the tag you want to display.

Now in the popup, use indirect tag bindings to read the tag's data at the path passed through the parameters.

popup:  
 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/a/a/aa9026c24195e1e935ac05cd2069a93da3b21c56.png)

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

opening the popup:

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

If you need to be able to open more than one instance of the same popup, I suggest you put that script in your library:

```python
from uuid import uuid4

def random_id():
	""" Generate a random id to be used for popups or other things that need to be uniquely identified. """
	return str(uuid4())

```

Then open your popups with a script (instead of the popup action):

```python
def runAction(self, event):
	popup_id = lib.utils.random_id()
	
	system.perspective.openPopup(
		id = popup_id,
		view = "path?to/your/popup/view",
		params = {
			'popup_id': popup_id,
			'tag_path': "path/to/tank1"
		}
	)

```

While not strictly necessary, I suggest you pass the popup id as a parameter to your popup. It's not always useful, but it often is.

---

<div class="post-metadata">

**Author:** ![Ahmed\_badawi1](https://avatars.discourse-cdn.com/v4/letter/a/58f4c7/32.png) [@Ahmed\_badawi1](https://forum.inductiveautomation.com/u/Ahmed_badawi1)\
**Post date:** [October 30, 2024, 7:50am UTC](https://forum.inductiveautomation.com/t/creating-one-popup-to-use-it-with-several-udt-tags-instances/97802/16 "2024-10-30T07:50:30Z")

</div>

ok, what will give the value to the popup view parameter "tag\_path" ?

---

<div class="post-metadata">

**Author:** ![pascal.fragnoud](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/pascal.fragnoud/32/24728_2.png) [@pascal.fragnoud](https://forum.inductiveautomation.com/u/pascal.fragnoud)\
**Post date:** [October 30, 2024, 8:31am UTC](https://forum.inductiveautomation.com/t/creating-one-popup-to-use-it-with-several-udt-tags-instances/97802/17 "2024-10-30T08:31:19Z")

</div>

You.

That really depends on where these come from.  
It could be a user-maintained list of tags, the result of a tag browse, or pretty much anything.

How did you set the session custom up until now ?

---

<div class="post-metadata">

**Author:** ![Ahmed\_badawi1](https://avatars.discourse-cdn.com/v4/letter/a/58f4c7/32.png) [@Ahmed\_badawi1](https://forum.inductiveautomation.com/u/Ahmed_badawi1)\
**Post date:** [October 30, 2024, 8:57am UTC](https://forum.inductiveautomation.com/t/creating-one-popup-to-use-it-with-several-udt-tags-instances/97802/18 "2024-10-30T08:57:17Z")

</div>

![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/a/2/a2d2f62c7c9f62c34acc96f384c976d96b4b7bcb.png)  
it's working! ,i connected the popup components with the popup custom property with the same shape as the udt and then connected this custom property to popup view parameter instead of session param,and i used two buttons to open popup (without script) and pass number 1,2,....etc to popup param and it worked!
