# Pass string array as parameter to popup

**URL:** <https://forum.inductiveautomation.com/t/pass-string-array-as-parameter-to-popup/37953>\
**Category:** Ignition\
**Tags:** ignition80\
**Created:** [August 20, 2020, 4:23pm UTC](https://forum.inductiveautomation.com/t/pass-string-array-as-parameter-to-popup/37953 "2020-08-20T16:23:37Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![scott.stamps](https://avatars.discourse-cdn.com/v4/letter/s/ba9def/32.png) [@scott.stamps](https://forum.inductiveautomation.com/u/scott.stamps)\
**Post date:** [August 20, 2020, 4:23pm UTC](https://forum.inductiveautomation.com/t/pass-string-array-as-parameter-to-popup/37953/1 "2020-08-20T16:23:38Z")

</div>

All - I am needing to pass an array of tag paths to a popup which will ultimately return a csv of the passed in tags’ history. However, the only way I can get this to work is to hard-code the paths. I have included screen shots in hopes that I’ve missed something simple. I have no idea if I am passing the paths parameter correctly or if any type-casting needs to happen.

Any help is appreciated. Thank you.

**Parameter declaration on the popup view:**  
 ![Annotation 2020-08-20 104611](https://us1.discourse-cdn.com/inductiveautomation/original/3X/b/b/bb3edc9312d234284bf440876c9028dafc2fc075.png)

**Passing of the parameter to the popup:**  
 ![Annotation 2020-08-20 104857](https://us1.discourse-cdn.com/inductiveautomation/original/3X/c/b/cbcb49b3be0e02564d8cac3ba233a57e9ff4f969.png)

**Label on the popup which is bound to the paths parameter** (just to verify what’s being passed):  
 ![Annotation 2020-08-20 1105](https://us1.discourse-cdn.com/inductiveautomation/original/3X/9/8/98ea64617a9ed1f059adf0f1617f5b553a0ce6e5.png)

**Script which is fired when the ‘Export To Csv’ is clicked:**

 ![Annotation 2020-08-20 1104](https://us1.discourse-cdn.com/inductiveautomation/original/3X/e/4/e4f5ef3f04b0581c957510ceae1392e5dc8aa02d.png)

**The exception in the gateway:**

 ![Annotation 2020-08-20 1108](https://us1.discourse-cdn.com/inductiveautomation/original/3X/6/d/6d7d0ce96b48102108c055a79f5cb0962474738a.png)

---

<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:** [August 20, 2020, 6:53pm UTC](https://forum.inductiveautomation.com/t/pass-string-array-as-parameter-to-popup/37953/2 "2020-08-20T18:53:01Z")

</div>

It looks like you’ve added some lines to your code AFTER you received the error message. Could you please provide the code as it is when the error is encountered?

What the problem LOOKS to be is that you’re attempting to pass a String (not a string array), and so the `paths` arg in the `queryTagHistory` function is failing. Your `# Does work` assignment of tagPaths works because it is actually a list of Strings, which is what the arg expects.

I would try the following:

1. create a custom property somewhere within your view to store the paths you want to use (mine is a custom property of the Button)  
 ![Screen Shot 2020-08-20 at 11.44.57 AM](https://us1.discourse-cdn.com/inductiveautomation/original/3X/9/1/9158fb8eaa38bdbca2a8af351f89a56753815fa0.png)
2. In the Popup Action dialog, identify the property you want to pass by using the property popover.  
 ![Screen Shot 2020-08-20 at 11.47.28 AM](https://us1.discourse-cdn.com/inductiveautomation/original/3X/b/8/b83426f11fadacd306c4c594b0d9f2396a87350f.png)

Please keep in mind that my recommendation is based on the assumption that lines 5 and 6 of your code screenshot were introduced AFTER you received that stacktrace. One thing you could also check is to print out the type of tagPaths after each assignment to see what you’re dealing with:

```auto
tagPaths = self.view.params.paths
# probably unicode
system.perspective.print("tagPaths type: {0}".format(type(tagPaths)))
tagPaths = ['[default]First', '[default]Second']
# probably list (or PyList)
system.perspective.print("tagPaths type: {0}".format(type(tagPaths)))

```

---

<div class="post-metadata">

**Author:** ![scott.stamps](https://avatars.discourse-cdn.com/v4/letter/s/ba9def/32.png) [@scott.stamps](https://forum.inductiveautomation.com/u/scott.stamps)\
**Post date:** [August 20, 2020, 8:09pm UTC](https://forum.inductiveautomation.com/t/pass-string-array-as-parameter-to-popup/37953/3 "2020-08-20T20:09:26Z")

</div>

Nice. So, like you, I added a custom property on a button, passed that to the popup, and it worked as expected. Is there a way to set the value of the array parameter (paths) inline - via the Configure Popup Action screen - along the lines of what I was originally doing? Thanks.

---

<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:** [August 20, 2020, 9:08pm UTC](https://forum.inductiveautomation.com/t/pass-string-array-as-parameter-to-popup/37953/4 "2020-08-20T21:08:05Z")

</div>

Not when the value is an array. Those inline fields are single-value fields. You could pass a single string value and parse it within the Popup, but that’s a hassle. What I personally recommend is only using the Popup action for the simplest of Popups. Any time I need to perform any Action which is not of the “simple” variety I ALWAYS use a Script Action and use a perspective package scripting method.

```auto
paths = ['[default]First', '[defaultSecond'] # or specify a property instead of a hard-coded list
system.perspective.togglePopup(id='mycsvpopup',params={paths=paths})

```

If you look at the [documentation](https://docs.inductiveautomation.com/display/DOC80/system.perspective.togglePopup), you’ll see that it allows for a much more dynamic setup as the behaviors can be dynamically changed at runtime and the params can be more than a single-value.

---

<div class="post-metadata">

**Author:** ![scott.stamps](https://avatars.discourse-cdn.com/v4/letter/s/ba9def/32.png) [@scott.stamps](https://forum.inductiveautomation.com/u/scott.stamps)\
**Post date:** [August 20, 2020, 9:11pm UTC](https://forum.inductiveautomation.com/t/pass-string-array-as-parameter-to-popup/37953/5 "2020-08-20T21:11:34Z")

</div>

Great. Appreciate the help!

---

<div class="post-metadata">

**Author:** ![jacque\_trahan](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/jacque_trahan/32/58886_2.png) [@jacque\_trahan](https://forum.inductiveautomation.com/u/jacque_trahan)\
**Post date:** [March 16, 2023, 8:23pm UTC](https://forum.inductiveautomation.com/t/pass-string-array-as-parameter-to-popup/37953/6 "2023-03-16T20:23:45Z")

</div>

Edit: I think I see my problem. I did not link the visuals to the Historical Playback component

I am trying to do this now with an [ignition exchange](https://www.inductiveautomation.com/exchange/108/overview) project that could be really helpful.  
I do not know all the inner workings of this setup, but I do know that the view's custom "tag" parameter will take a tag's path and then that tags value will be added to a "value" param. The number of values will automatically increases, based on a change script, to equal the number of tags. I will use that project as a pop up window to take all values on the screen and we can manually see the history as needed.

That said here is what I did. Steps:

1. Made a custom property on the view's root.  
 ![step 1](https://us1.discourse-cdn.com/inductiveautomation/original/3X/e/6/e61e235be2bb5b218bb815bfd8848196ff83db36.png)
2. Added each path I needed to that custom property(Just two for now to test)
3. Then add that to the property popup(Like step two above)  
 ![step 3](https://us1.discourse-cdn.com/inductiveautomation/original/3X/8/8/880239e41213416833d6ad945d71e582a471b2de.png)

Maybe there is something I do not understand in that exchange property, but wanted to get another pair of eyes on it to be sure I am not missing something. Any help would great and thanks in advance.
