# Use tags metadata field value in another field

**URL:** <https://forum.inductiveautomation.com/t/use-tags-metadata-field-value-in-another-field/16996>\
**Category:** Ignition\
**Created:** [February 15, 2018, 7:21am UTC](https://forum.inductiveautomation.com/t/use-tags-metadata-field-value-in-another-field/16996 "2018-02-15T07:21:04Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Claus\_Nielsen](https://avatars.discourse-cdn.com/v4/letter/c/77aa72/32.png) [@Claus\_Nielsen](https://forum.inductiveautomation.com/u/Claus_Nielsen)\
**Post date:** [February 15, 2018, 7:21am UTC](https://forum.inductiveautomation.com/t/use-tags-metadata-field-value-in-another-field/16996/1 "2018-02-15T07:21:05Z")

</div>

Wondering, is it possible to use a tags metadata field value in another metadata field?  
As an example, in the tooltip or description fields write something like “The actual position in {EngUnits}” where EngUnits is whatever engineering unit currently specified for the tag?

---

<div class="post-metadata">

**Author:** ![jonathan.taylor](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/jonathan.taylor/32/4048_2.png) [@jonathan.taylor](https://forum.inductiveautomation.com/u/jonathan.taylor)\
**Post date:** [February 15, 2018, 9:52am UTC](https://forum.inductiveautomation.com/t/use-tags-metadata-field-value-in-another-field/16996/2 "2018-02-15T09:52:33Z")

</div>

Yes you can,

You’d need a script for it as it doesn’t seem like you can write expressions directly into those properties.

The way I looked at it was a Tag Event script under Value Changed - this is probably overkill as it’ll run the script every time the value changes, but at least if somehow the string inside Tooltip was accidentally removed, it’d just put it back there on the next value change.

Here’s the script:

```
tagPath1 = tagPath+".EngUnit"
tagPath2 = tagPath+".Tooltip"
tag=system.tag.read(tagPath1)
tooltip = "The actual position in "+tag.value
system.tag.write(tagPath2,tooltip)

```

Say the EngUnit was °C, the script would place “The actual position in °C” in the Tooltip of the tag.

Obviously you can substitute “.Tooltip” with “.Description” if you want

---

<div class="post-metadata">

**Author:** ![Claus\_Nielsen](https://avatars.discourse-cdn.com/v4/letter/c/77aa72/32.png) [@Claus\_Nielsen](https://forum.inductiveautomation.com/u/Claus_Nielsen)\
**Post date:** [February 15, 2018, 11:52am UTC](https://forum.inductiveautomation.com/t/use-tags-metadata-field-value-in-another-field/16996/3 "2018-02-15T11:52:26Z")

</div>

Thank you, seems to be more complex than what I had hoped though. Had hoped for some simple solution within the tag editor itself.

---

<div class="post-metadata">

**Author:** ![Sanderd17](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/sanderd17/32/8735_2.png) [@Sanderd17](https://forum.inductiveautomation.com/u/Sanderd17)\
**Post date:** [February 15, 2018, 12:24pm UTC](https://forum.inductiveautomation.com/t/use-tags-metadata-field-value-in-another-field/16996/4 "2018-02-15T12:24:35Z")

</div>

The best way is probably to use an UDT where you define parameters. F.e. myUnit

Then you can refer from EngUnit to that parameter by using {myUnit} there. And you can also use it in the tooltip string.

---

<div class="post-metadata">

**Author:** ![Claus\_Nielsen](https://avatars.discourse-cdn.com/v4/letter/c/77aa72/32.png) [@Claus\_Nielsen](https://forum.inductiveautomation.com/u/Claus_Nielsen)\
**Post date:** [February 16, 2018, 6:18am UTC](https://forum.inductiveautomation.com/t/use-tags-metadata-field-value-in-another-field/16996/5 "2018-02-16T06:18:36Z")

</div>

That is what I ended up doing.
