# Template Internal Property with Expression

**URL:** <https://forum.inductiveautomation.com/t/template-internal-property-with-expression/37358>\
**Category:** Ignition\
**Tags:** ignition79\
**Created:** [August 4, 2020, 2:12pm UTC](https://forum.inductiveautomation.com/t/template-internal-property-with-expression/37358 "2020-08-04T14:12:08Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Luke.Pascall](https://avatars.discourse-cdn.com/v4/letter/l/85f322/32.png) [@Luke.Pascall](https://forum.inductiveautomation.com/u/Luke.Pascall)\
**Post date:** [August 4, 2020, 2:12pm UTC](https://forum.inductiveautomation.com/t/template-internal-property-with-expression/37358/1 "2020-08-04T14:12:09Z")

</div>

Hello all,

I’m using a template with an internal property based on some passed in opc tags.  
When I update the project some of the templates will show bad expressions:  
 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/c/9/c959d83fa6629d7e8bb58ed675e12a7215969179.png)

Once I physically toggle the sensor tied to the template the bad expression overlay goes away.  
The expression I’m using is:

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

How can I stop this bad expression overlay from showing up?

Thank you!  
Luke

---

<div class="post-metadata">

**Author:** ![bschroeder](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/bschroeder/32/13260_2.png) [@bschroeder](https://forum.inductiveautomation.com/u/bschroeder)\
**Post date:** [August 4, 2020, 2:15pm UTC](https://forum.inductiveautomation.com/t/template-internal-property-with-expression/37358/2 "2020-08-04T14:15:15Z")

</div>

wrap your expression in the try expression: [https://docs.inductiveautomation.com/display/DOC80/try](https://docs.inductiveautomation.com/display/DOC80/try)

```auto
try(
    if({1 PickBox.PtL::Sensor},if({1 PickBox.PtL::Light},1,2),0),
    0 // Default if there are errors in either of the two if statements
    )

```

---

<div class="post-metadata">

**Author:** ![Luke.Pascall](https://avatars.discourse-cdn.com/v4/letter/l/85f322/32.png) [@Luke.Pascall](https://forum.inductiveautomation.com/u/Luke.Pascall)\
**Post date:** [August 4, 2020, 7:30pm UTC](https://forum.inductiveautomation.com/t/template-internal-property-with-expression/37358/3 "2020-08-04T19:30:50Z")

</div>

This worked. Thank you!
