# Binding works in designer but not in browser

**URL:** <https://forum.inductiveautomation.com/t/binding-works-in-designer-but-not-in-browser/103897>\
**Category:** Ignition\
**Tags:** perspective\
**Created:** [March 19, 2025, 4:08pm UTC](https://forum.inductiveautomation.com/t/binding-works-in-designer-but-not-in-browser/103897 "2025-03-19T16:08:58Z")\
**Posts on this page:** 17\
**Page:** 1

<div class="post-metadata">

**Author:** ![Jacob\_Clark](https://avatars.discourse-cdn.com/v4/letter/j/43a26b/32.png) [@Jacob\_Clark](https://forum.inductiveautomation.com/u/Jacob_Clark)\
**Post date:** [March 19, 2025, 4:08pm UTC](https://forum.inductiveautomation.com/t/binding-works-in-designer-but-not-in-browser/103897/1 "2025-03-19T16:08:58Z")

</div>

Hey guys I've been working on making template views that change content based on provided parameters

I have an accordion that i do not want to display when my view.params.apm\_id = 1

here is the binding on the display property:  
if (  
{view.params.apm\_id} = 1,  
false,  
true  
)

in the designer when view.params.apm\_id = 1 the accordion is hidden but on the browser it is not

any help would be greatly appreciated

---

<div class="post-metadata">

**Author:** ![Ryan\_Deardorff](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/ryan_deardorff/32/63815_2.png) [@Ryan\_Deardorff](https://forum.inductiveautomation.com/u/Ryan_Deardorff)\
**Post date:** [March 19, 2025, 4:15pm UTC](https://forum.inductiveautomation.com/t/binding-works-in-designer-but-not-in-browser/103897/2 "2025-03-19T16:15:03Z")

</div>

This probably isn't the issue, but that expression can be simplified to just:

`{view.params.apm_id} != 1`

---

<div class="post-metadata">

**Author:** ![Jacob\_Clark](https://avatars.discourse-cdn.com/v4/letter/j/43a26b/32.png) [@Jacob\_Clark](https://forum.inductiveautomation.com/u/Jacob_Clark)\
**Post date:** [March 19, 2025, 4:17pm UTC](https://forum.inductiveautomation.com/t/binding-works-in-designer-but-not-in-browser/103897/3 "2025-03-19T16:17:33Z")

</div>

That does simplify it, I didn't realize I could do that, thank you. However yes it didn't fix my issue

---

<div class="post-metadata">

**Author:** ![Alejandro\_Alaco](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/alejandro_alaco/32/59849_2.png) [@Alejandro\_Alaco](https://forum.inductiveautomation.com/u/Alejandro_Alaco)\
**Post date:** [March 19, 2025, 4:21pm UTC](https://forum.inductiveautomation.com/t/binding-works-in-designer-but-not-in-browser/103897/4 "2025-03-19T16:21:00Z")

</div>

You may try use == instead =

---

<div class="post-metadata">

**Author:** ![Transistor](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/transistor/32/3380_2.png) [@Transistor](https://forum.inductiveautomation.com/u/Transistor)\
**Post date:** [March 19, 2025, 4:24pm UTC](https://forum.inductiveautomation.com/t/binding-works-in-designer-but-not-in-browser/103897/5 "2025-03-19T16:24:09Z")

</div>

> [@Alejandro\_Alaco](#):
>
> try use == instead =

You may not. That's script (Python) syntax. This thread seems to be about an expression.

---

<div class="post-metadata">

**Author:** ![Transistor](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/transistor/32/3380_2.png) [@Transistor](https://forum.inductiveautomation.com/u/Transistor)\
**Post date:** [March 19, 2025, 4:25pm UTC](https://forum.inductiveautomation.com/t/binding-works-in-designer-but-not-in-browser/103897/6 "2025-03-19T16:25:05Z")

</div>

> [@Ryan\_Deardorff](#):
>
> {view.params.apm\_id} != 1

Try  
`!{view.params.apm_id}`

---

<div class="post-metadata">

**Author:** ![Jacob\_Clark](https://avatars.discourse-cdn.com/v4/letter/j/43a26b/32.png) [@Jacob\_Clark](https://forum.inductiveautomation.com/u/Jacob_Clark)\
**Post date:** [March 19, 2025, 4:35pm UTC](https://forum.inductiveautomation.com/t/binding-works-in-designer-but-not-in-browser/103897/7 "2025-03-19T16:35:57Z")

</div>

it shouldn't be the expression that is the issue. It works in the designer and appropriately hides the accordion when view.params.apm\_id = 1 however in a web browser it does not hide it when view.params.apm\_id = 1

designer (when apm\_id != 1):

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

designer (when apm\_id = 1, notice how steam accordion disappears):

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

in browser when apm\_id = 1:

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

Notice how the steam accordion is displaying in the browser when it should be hidden like the designer when apm\_id = 1? Also APM # at the top is displaying {view.params.apm\_id} thats how I know it is 1

---

<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:** [March 19, 2025, 4:43pm UTC](https://forum.inductiveautomation.com/t/binding-works-in-designer-but-not-in-browser/103897/8 "2025-03-19T16:43:09Z")

</div>

Don't know where your parameters are coming from, but you can throw a label on the view temporarily and double check that the datatype is what you expect it to be (int vs string)

---

<div class="post-metadata">

**Author:** ![vtran](https://avatars.discourse-cdn.com/v4/letter/v/779978/32.png) [@vtran](https://forum.inductiveautomation.com/u/vtran)\
**Post date:** [March 19, 2025, 4:44pm UTC](https://forum.inductiveautomation.com/t/binding-works-in-designer-but-not-in-browser/103897/9 "2025-03-19T16:44:21Z")

</div>

Maybe it's a security thing? Are you logged in on the browser as well? I noticed that your Valve Position binding is bad as well

> [@Jacob\_Clark](#):
>
> in browser when apm\_id = 1:
> 
> ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/3/6/3697317e8a00e86a0e73adf994d2b7fa3e2483b0.png)
> 
> Notice how the steam accordion is displaying in the browser when it should be hidden like the designer when apm\_id = 1? Also APM # at the top is displaying {view.params.apm\_id} thats how I know it is 1

---

<div class="post-metadata">

**Author:** ![Jacob\_Clark](https://avatars.discourse-cdn.com/v4/letter/j/43a26b/32.png) [@Jacob\_Clark](https://forum.inductiveautomation.com/u/Jacob_Clark)\
**Post date:** [March 19, 2025, 5:02pm UTC](https://forum.inductiveautomation.com/t/binding-works-in-designer-but-not-in-browser/103897/10 "2025-03-19T17:02:47Z")

</div>

I wasn't evening thinking about that

I pass my apm\_id parameter through the url like so  
 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/8/4/84401c1cb65a064fb713b35ec78679e8a5db6978.png)

and this is the class, which would definitely explain why it doesn't work in a browser. I ASSUMED it would be automatically casted into a number but I was wrong  
 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/c/b/cb9eaa49883a2befa2cf6c9b346ebdc84d292d24.png)

---

<div class="post-metadata">

**Author:** ![Transistor](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/transistor/32/3380_2.png) [@Transistor](https://forum.inductiveautomation.com/u/Transistor)\
**Post date:** [March 19, 2025, 5:13pm UTC](https://forum.inductiveautomation.com/t/binding-works-in-designer-but-not-in-browser/103897/11 "2025-03-19T17:13:13Z")

</div>

I haven't figured out exactly what you are trying to do, but parameters are only read when the view first loads. That means that you can't use a view parameter to switch something on and off.

Instead, pass in the tag path as a parameter and create a binding _inside the view_ to control whatever it is you want.

---

<div class="post-metadata">

**Author:** ![Simon\_Hathout\_Willar](https://avatars.discourse-cdn.com/v4/letter/s/3da27b/32.png) [@Simon\_Hathout\_Willar](https://forum.inductiveautomation.com/u/Simon_Hathout_Willar)\
**Post date:** [March 19, 2025, 5:40pm UTC](https://forum.inductiveautomation.com/t/binding-works-in-designer-but-not-in-browser/103897/12 "2025-03-19T17:40:55Z")

</div>

> [@Transistor](#):
>
> pass in the tag path as a parameter

Are there any risks possible when allowing the user to select an arbitrary tag path to read from? Eg, they can manually change the URL to inspect any true/false tag, in theory.

Probably better to have it get only part of the tag path, so you can limit the area to only one folder of tags.

---

<div class="post-metadata">

**Author:** ![Jacob\_Clark](https://avatars.discourse-cdn.com/v4/letter/j/43a26b/32.png) [@Jacob\_Clark](https://forum.inductiveautomation.com/u/Jacob_Clark)\
**Post date:** [March 19, 2025, 6:07pm UTC](https://forum.inductiveautomation.com/t/binding-works-in-designer-but-not-in-browser/103897/13 "2025-03-19T18:07:11Z")

</div>

Yes that is why I was using params, I figured out the problem and it was because it was loaded as unicode on perspective because it was a page parameter

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

so I just adjusted my binding to this:

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

and now it works in both perspective and the designer

---

<div class="post-metadata">

**Author:** ![ryan.white](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/ryan.white/32/73193_2.png) [@ryan.white](https://forum.inductiveautomation.com/u/ryan.white)\
**Post date:** [March 19, 2025, 6:14pm UTC](https://forum.inductiveautomation.com/t/binding-works-in-designer-but-not-in-browser/103897/14 "2025-03-19T18:14:59Z")

</div>

Did you try the expression language's type coercion? `toInt({view.params.apm_id}) != 1`. Should be equivalent to (and faster and lighter weight than) your script transform. (It would remove the need for a transform entirely)

If this is a parameter being passed in via URL I believe all URL parameters are treated as strings.

---

<div class="post-metadata">

**Author:** ![Ryan\_Deardorff](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/ryan_deardorff/32/63815_2.png) [@Ryan\_Deardorff](https://forum.inductiveautomation.com/u/Ryan_Deardorff)\
**Post date:** [March 19, 2025, 6:16pm UTC](https://forum.inductiveautomation.com/t/binding-works-in-designer-but-not-in-browser/103897/15 "2025-03-19T18:16:08Z")

</div>

I would still stick with the Expression transform over Script, as they execute significantly faster. It may not matter much for such a simple expression, but it's a good rule in general.

---

<div class="post-metadata">

**Author:** ![Jacob\_Clark](https://avatars.discourse-cdn.com/v4/letter/j/43a26b/32.png) [@Jacob\_Clark](https://forum.inductiveautomation.com/u/Jacob_Clark)\
**Post date:** [March 19, 2025, 8:34pm UTC](https://forum.inductiveautomation.com/t/binding-works-in-designer-but-not-in-browser/103897/16 "2025-03-19T20:34:31Z")

</div>

Thank you I was not aware I could use an expression to convert types

---

<div class="post-metadata">

**Author:** ![ryan.white](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/ryan.white/32/73193_2.png) [@ryan.white](https://forum.inductiveautomation.com/u/ryan.white)\
**Post date:** [March 19, 2025, 8:35pm UTC](https://forum.inductiveautomation.com/t/binding-works-in-designer-but-not-in-browser/103897/17 "2025-03-19T20:35:16Z")

</div>

Docs for all the available expression functions:

> **[Expression Functions | Ignition User Manual](https://www.docs.inductiveautomation.com/docs/8.1/appendix/expression-functions)**
>
> The expression language is used to define dynamic values for component properties and expression tags. Expressions often involve one or more other values that are used to calculate a final value. Expressions don't do anything, other than return a...
