# Tag = value else Tag = opc value

**URL:** <https://forum.inductiveautomation.com/t/tag-value-else-tag-opc-value/44578>\
**Category:** Ignition\
**Created:** [March 17, 2021, 1:54pm UTC](https://forum.inductiveautomation.com/t/tag-value-else-tag-opc-value/44578 "2021-03-17T13:54:37Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![kghali](https://avatars.discourse-cdn.com/v4/letter/k/da6949/32.png) [@kghali](https://forum.inductiveautomation.com/u/kghali)\
**Post date:** [March 17, 2021, 1:54pm UTC](https://forum.inductiveautomation.com/t/tag-value-else-tag-opc-value/44578/1 "2021-03-17T13:54:37Z")

</div>

What’s the expression for doing this:  
If tag0 == 1:  
tag1 = 1  
else  
tag1 = value of opc item path xxxx

I can’t figure out how to do the opc part only

---

<div class="post-metadata">

**Author:** ![JordanCClark](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/jordancclark/32/83362_2.png) [@JordanCClark](https://forum.inductiveautomation.com/u/JordanCClark)\
**Post date:** [March 17, 2021, 2:13pm UTC](https://forum.inductiveautomation.com/t/tag-value-else-tag-opc-value/44578/2 "2021-03-17T14:13:41Z")

</div>

You can’t directly access an OPC path in an expression. You would need an OPC tag.  
Then, with tag1 as an expression tag:

```auto
if([default]path/to/tag0} = 1,
   1,
   {[default]path/to/opcTag}
  )
```
