# Multiple instances of popups in Perspective

**URL:** <https://forum.inductiveautomation.com/t/multiple-instances-of-popups-in-perspective/53555>\
**Category:** Ignition\
**Tags:** perspective\
**Created:** [November 30, 2021, 2:12am UTC](https://forum.inductiveautomation.com/t/multiple-instances-of-popups-in-perspective/53555 "2021-11-30T02:12:08Z")\
**Posts on this page:** 12\
**Page:** 1

<div class="post-metadata">

**Author:** ![Krzysztof\_Lesiak](https://avatars.discourse-cdn.com/v4/letter/k/ba9def/32.png) [@Krzysztof\_Lesiak](https://forum.inductiveautomation.com/u/Krzysztof_Lesiak)\
**Post date:** [November 30, 2021, 2:12am UTC](https://forum.inductiveautomation.com/t/multiple-instances-of-popups-in-perspective/53555/1 "2021-11-30T02:12:08Z")

</div>

Hi guys,

I’m trying to prepare base of project and I’m working on devices faceplates (valves, motors, DI,AI, etc.). I prepared nice popup already so only thing I need is to send Device name and it is connecting popup to correct UDT instance. Problem I found is that I cannot use multiple instances of one window in Perspective. I found solution that I have multiple windows called “Sample\_Motor\_i1”, “Sample Motor\_i2” and small script which is checking which instances are already opened and which one should be open next. Problem is that my script is not working as it should:

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

This is beginning of my script so variable inst1 is read from array of memory Booleans. Every member of that array is set and reset in corresponding popup instance so:  
Instances[1] is set when Simple\_Motor\_i1 opens and reset when it closes. If is open then if condition is not true and it is checking Instances[2] and so on.

What is interesting it is not opening popups at all. What is more interesting I used “New Tag to” display current Instance[1] value and if it is displaying false first if should be right and it is not.

I’m using Ignition 8.1.9

Thanks  
Krzysztof

---

<div class="post-metadata">

**Author:** ![jespinmartin1](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/jespinmartin1/32/57175_2.png) [@jespinmartin1](https://forum.inductiveautomation.com/u/jespinmartin1)\
**Post date:** [November 30, 2021, 2:52am UTC](https://forum.inductiveautomation.com/t/multiple-instances-of-popups-in-perspective/53555/2 "2021-11-30T02:52:02Z")

</div>

Haha it was funny to read “Prospective” so many times.

Well this is a terrible approach starting by the fact you are using gateway tags as a memory collector of opened views. This means that all opened sessions won’t work as expected because if session A has popup opened, session B might not but still will be interpreted as open because of that memory Boolean Array.

You should create a session custom prop that appends all the ids of opened popups.  
 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/a/d/ad9d76e1fff8ccb2e1bb42e9f19b1f0b59eef87a.png)

The Pseudo Code should be: (make sure to send the id as a parameter also)

```auto
openedPopups = self.session.custom.openedPopups
	
if 'Simple_Motor_i1' not in openedPopups:
	system.perspective.openPopup(...x, params = {....'id' : 'Simple_Motor_i1'})
elif 'Simple_Motor_i2' not in openedPopups:
	system.perspective.openPopup(...y, params = {....'id' : 'Simple_Motor_i2'})

```

Finally, on the popup view a script on the view when it shutdowns to basically remove from the session array the popup id.

 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/9/8/98e20e5d394553263d9c1e794c66593d35a2f12b.png)

---

<div class="post-metadata">

**Author:** ![Krzysztof\_Lesiak](https://avatars.discourse-cdn.com/v4/letter/k/ba9def/32.png) [@Krzysztof\_Lesiak](https://forum.inductiveautomation.com/u/Krzysztof_Lesiak)\
**Post date:** [November 30, 2021, 3:17am UTC](https://forum.inductiveautomation.com/t/multiple-instances-of-popups-in-perspective/53555/3 "2021-11-30T03:17:26Z")

</div>

Sorry for “Prospective” no idea why I called it like this. Thanks for explanation - that is really good point I missed!

Still I’m curious why simple read tag is working in one line and is not in second line in if statement.

---

<div class="post-metadata">

**Author:** ![jespinmartin1](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/jespinmartin1/32/57175_2.png) [@jespinmartin1](https://forum.inductiveautomation.com/u/jespinmartin1)\
**Post date:** [November 30, 2021, 3:18am UTC](https://forum.inductiveautomation.com/t/multiple-instances-of-popups-in-perspective/53555/4 "2021-11-30T03:18:49Z")

</div>

You are missing .value method. I think, to read the actual value

---

<div class="post-metadata">

**Author:** ![Krzysztof\_Lesiak](https://avatars.discourse-cdn.com/v4/letter/k/ba9def/32.png) [@Krzysztof\_Lesiak](https://forum.inductiveautomation.com/u/Krzysztof_Lesiak)\
**Post date:** [November 30, 2021, 3:23am UTC](https://forum.inductiveautomation.com/t/multiple-instances-of-popups-in-perspective/53555/5 "2021-11-30T03:23:46Z")

</div>

Unfortunately that is not true. I was trying it

---

<div class="post-metadata">

**Author:** ![cmallonee](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/cmallonee/32/6416_2.png) [@cmallonee](https://forum.inductiveautomation.com/u/cmallonee)\
**Post date:** [November 30, 2021, 3:24am UTC](https://forum.inductiveautomation.com/t/multiple-instances-of-popups-in-perspective/53555/6 "2021-11-30T03:24:03Z")

</div>

There are lots of things going on here.

1. Per the documentation, [readBlocking](https://docs.inductiveautomation.com/display/DOC81/system.tag.readBlocking) expects a list of tag paths, but you’re only sending a string.
2. openPopup needs access to a Perspective thread which has a page context, OR it needs a specific pageId to target so that it can open the Popup on that page. To get this working, you’ll either need to pass a pageId argument into this function or you’ll need this function to return some value that you can use inside of a component or session Event.

In both cases, these errors should be immediately visible if you look into the logs present on your Gateway.

---

<div class="post-metadata">

**Author:** ![jespinmartin1](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/jespinmartin1/32/57175_2.png) [@jespinmartin1](https://forum.inductiveautomation.com/u/jespinmartin1)\
**Post date:** [November 30, 2021, 3:27am UTC](https://forum.inductiveautomation.com/t/multiple-instances-of-popups-in-perspective/53555/7 "2021-11-30T03:27:15Z")

</div>

`system.tag.readBlocking(['path'])[0].getValue()`  
But still, you won’t need that since you should not use it.

---

<div class="post-metadata">

**Author:** ![Krzysztof\_Lesiak](https://avatars.discourse-cdn.com/v4/letter/k/ba9def/32.png) [@Krzysztof\_Lesiak](https://forum.inductiveautomation.com/u/Krzysztof_Lesiak)\
**Post date:** [November 30, 2021, 4:20am UTC](https://forum.inductiveautomation.com/t/multiple-instances-of-popups-in-perspective/53555/8 "2021-11-30T04:20:30Z")

</div>

Many thanks. All is working like it should!

---

<div class="post-metadata">

**Author:** ![sfatimazahrak](https://avatars.discourse-cdn.com/v4/letter/s/c2a13f/32.png) [@sfatimazahrak](https://forum.inductiveautomation.com/u/sfatimazahrak)\
**Post date:** [August 20, 2025, 12:25pm UTC](https://forum.inductiveautomation.com/t/multiple-instances-of-popups-in-perspective/53555/9 "2025-08-20T12:25:38Z")

</div>

is there a way to make this more dynamic? ive configured pop-up action on all my objects[views, and ive used multiple instances of them on my main view], but my pop-up has a unique ID specific to the global object (view) which is why im unable to open multiple instances of the pop up, how do i append the multiple ids without having to manually send in the ids with the popup for each embedded view?

---

<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:** [August 20, 2025, 4:43pm UTC](https://forum.inductiveautomation.com/t/multiple-instances-of-popups-in-perspective/53555/10 "2025-08-20T16:43:05Z")

</div>

generate your popup ids when you open them.  
I use this:

```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())

```

If you used a hardcoded id for css purposes, you can prefix the randomly generated id with something unique, and use `.ia_popup[id^=your_prefix]` in your selector.

---

<div class="post-metadata">

**Author:** ![sfatimazahrak](https://avatars.discourse-cdn.com/v4/letter/s/c2a13f/32.png) [@sfatimazahrak](https://forum.inductiveautomation.com/u/sfatimazahrak)\
**Post date:** [August 21, 2025, 4:59am UTC](https://forum.inductiveautomation.com/t/multiple-instances-of-popups-in-perspective/53555/11 "2025-08-21T04:59:45Z")

</div>

I was going to bind them to a parameter that was already unique for every object, but i suppose this works too

---

<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:** [August 21, 2025, 6:38am UTC](https://forum.inductiveautomation.com/t/multiple-instances-of-popups-in-perspective/53555/12 "2025-08-21T06:38:16Z")

</div>

The binding is a good way to do it too, especially if it carries meaning about the popup
