# Passing Literals to a Popup in Perspective

**URL:** <https://forum.inductiveautomation.com/t/passing-literals-to-a-popup-in-perspective/74083>\
**Category:** Ignition\
**Tags:** ignition81, perspective\
**Created:** [May 23, 2023, 4:57pm UTC](https://forum.inductiveautomation.com/t/passing-literals-to-a-popup-in-perspective/74083 "2023-05-23T16:57:25Z")\
**Posts on this page:** 11\
**Page:** 1

<div class="post-metadata">

**Author:** ![Brandon\_Peterson](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/brandon_peterson/32/32960_2.png) [@Brandon\_Peterson](https://forum.inductiveautomation.com/u/Brandon_Peterson)\
**Post date:** [May 23, 2023, 4:57pm UTC](https://forum.inductiveautomation.com/t/passing-literals-to-a-popup-in-perspective/74083/1 "2023-05-23T16:57:25Z")

</div>

I'm trying to pass a literal boolean value to a popup view, but it appears that the parameters input isn't using Ignition's Expression language. Here's the error message I get:

`Subcode: Error_ExpressionEval`  
`'if' function expected a boolean or numeric first argument, but got a class java.lang.String`

I get this error when I enter `False` or `0`. It appears to just pass it as a string, even though the parameter is a boolean. My first thought is to create an `AlwaysFalse` custom property or just switch the if-statement to `if({view.params.isReject} = 'True', ...`, but that isn't exactly intuitive. **Is there a better way of going about this?**

_Popup View Parameters_  
 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/3/0/309011abe87650f496ed18eb99e5de8cfa4498c5.png)

_Main View Button Action Config_

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

_Popup View Error-Throwing Expression_  
 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/3/f/3feb6bae63c666a2b88d328e4a7ac25cfa3dd24e.png)

I'm using Ignition `v8.1.17 (b2022051210)`. If this functionality has changed in any more recent update, I could upgrade instead.

---

<div class="post-metadata">

**Author:** ![djs](https://avatars.discourse-cdn.com/v4/letter/d/e47774/32.png) [@djs](https://forum.inductiveautomation.com/u/djs)\
**Post date:** [May 23, 2023, 5:10pm UTC](https://forum.inductiveautomation.com/t/passing-literals-to-a-popup-in-perspective/74083/2 "2023-05-23T17:10:42Z")

</div>

> [@Brandon\_Peterson](#):
>
> I get this error when I enter `False`

> [@Brandon\_Peterson](#):
>
> `if({view.params.isReject} = 'True', ...`,

In python the bools are capitalized. Elsewhere they are not capitalized. When you pass your boolean value, it should be `false` or `true` rather than `False` or `True`

---

<div class="post-metadata">

**Author:** ![Siebold](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/siebold/32/47336_2.png) [@Siebold](https://forum.inductiveautomation.com/u/Siebold)\
**Post date:** [May 23, 2023, 5:15pm UTC](https://forum.inductiveautomation.com/t/passing-literals-to-a-popup-in-perspective/74083/3 "2023-05-23T17:15:11Z")

</div>

use this:

```auto
'Enter Qty '
+ if(toBoolean({view.params.isReject}),'Rejected','Passed'
)

```

That should work. The value is being passed as a string so it needs to be converted.

---

<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:** [May 23, 2023, 5:16pm UTC](https://forum.inductiveautomation.com/t/passing-literals-to-a-popup-in-perspective/74083/4 "2023-05-23T17:16:55Z")

</div>

It doesn't have to be passed as a string. Literal booleans do exist and should be used where appropriate, without having to resort to casting them.

---

<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:** [May 23, 2023, 5:27pm UTC](https://forum.inductiveautomation.com/t/passing-literals-to-a-popup-in-perspective/74083/5 "2023-05-23T17:27:23Z")

</div>

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

This seems like the source of the problem. I would _bet_ that the parameter config is going to coerce whatever you pass here into a string, so whether you specify `True` or `true` in that text field, it's going to be passed into the popup as `"True"` or `"true"`.

---

<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:** [May 23, 2023, 5:34pm UTC](https://forum.inductiveautomation.com/t/passing-literals-to-a-popup-in-perspective/74083/6 "2023-05-23T17:34:29Z")

</div>

One more reason to use `system.perspective.openPopup` :X

---

<div class="post-metadata">

**Author:** ![Brandon\_Peterson](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/brandon_peterson/32/32960_2.png) [@Brandon\_Peterson](https://forum.inductiveautomation.com/u/Brandon_Peterson)\
**Post date:** [May 23, 2023, 6:51pm UTC](https://forum.inductiveautomation.com/t/passing-literals-to-a-popup-in-perspective/74083/7 "2023-05-23T18:51:32Z")

</div>

So if I just ran it as a script, I assume I can avoid the string coercion issue.

@paul-griffith I've tested it, and yes, the capitalization doesn't matter. It appears to be a string with `{bracket}` notated inserts rather than an actual expression. Should I create a suggestion on the Features and Ideas site?

---

<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:** [May 23, 2023, 7:29pm UTC](https://forum.inductiveautomation.com/t/passing-literals-to-a-popup-in-perspective/74083/8 "2023-05-23T19:29:40Z")

</div>

Curly braces means it's trying to evaluate whatever set in the config dialog as a property reference. This seems to be working as intended. For more dynamic variable passthrough, I think the script is fine.

---

<div class="post-metadata">

**Author:** ![Brandon\_Peterson](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/brandon_peterson/32/32960_2.png) [@Brandon\_Peterson](https://forum.inductiveautomation.com/u/Brandon_Peterson)\
**Post date:** [May 23, 2023, 7:48pm UTC](https://forum.inductiveautomation.com/t/passing-literals-to-a-popup-in-perspective/74083/9 "2023-05-23T19:48:50Z")

</div>

I agree. But I made this post because I expected it to be the Expression language (or at least something with types), not a simple property reference coerced to a string.

After further testing, I've realized that the property reference happens once; it's not a live connection. If the property referenced in the parameter changes, then nothing happens in the popup. This would also imply that if the Expression language were to be implemented here, that would be a breaking change, because some projects may rely on a copy of that referenced property to be saved when passed into the new view. I think this means that **popup view parameters were designed to be static after initialization.**

After further further testing, I've realized that direct property references do in fact respect the type of the property they're referencing. I created an `alwaysTrue` custom property and passed that in to the view, and that was parsed as a boolean. So, **the issue that remains is the inability to insert boolean or numerical literals into a popup parameter.** I think this is a reasonable feature add, so I'll post a summary on the Features and Ideas site.

Thanks all for your help!

---

<div class="post-metadata">

**Author:** ![jacob\_geers](https://avatars.discourse-cdn.com/v4/letter/j/4da419/32.png) [@jacob\_geers](https://forum.inductiveautomation.com/u/jacob_geers)\
**Post date:** [June 3, 2025, 2:39pm UTC](https://forum.inductiveautomation.com/t/passing-literals-to-a-popup-in-perspective/74083/10 "2025-06-03T14:39:22Z")

</div>

My slightly similar problem when using onActionPerformed -\> Popup is the difference between designer and the browser. As this thread points out, the param is being forced through as a string so my logic inside the popup is `if (type == "2")`. This is fine, but when designing, I can't put 2 in the designer without it being forced as an int. "2" does not work either.

I suppose I would have to test for both string and int in my logic or make a custom param for the input param?

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

---

<div class="post-metadata">

**Author:** ![pturmel](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/pturmel/32/3295_2.png) [@pturmel](https://forum.inductiveautomation.com/u/pturmel)\
**Post date:** [June 3, 2025, 2:56pm UTC](https://forum.inductiveautomation.com/t/passing-literals-to-a-popup-in-perspective/74083/11 "2025-06-03T14:56:36Z")

</div>

Page parameters are always strings. (URLs are strings.) You should use an expression binding, on a view custom property, with `toInt()` to interpret string parameters as integers.
