# Is there a way to set a tag value to the value of a custom property in vision?

**URL:** <https://forum.inductiveautomation.com/t/is-there-a-way-to-set-a-tag-value-to-the-value-of-a-custom-property-in-vision/66013>\
**Category:** Ignition\
**Tags:** ignition81, vision\
**Created:** [November 2, 2022, 5:46pm UTC](https://forum.inductiveautomation.com/t/is-there-a-way-to-set-a-tag-value-to-the-value-of-a-custom-property-in-vision/66013 "2022-11-02T17:46:48Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![IvanP](https://avatars.discourse-cdn.com/v4/letter/i/74df32/32.png) [@IvanP](https://forum.inductiveautomation.com/u/IvanP)\
**Post date:** [November 2, 2022, 5:46pm UTC](https://forum.inductiveautomation.com/t/is-there-a-way-to-set-a-tag-value-to-the-value-of-a-custom-property-in-vision/66013/1 "2022-11-02T17:46:49Z")

</div>

Hello,

Is there a way to write the value of a custom property to a tag in vision?

I am trying to figure out the best way to convert the polyol factor (which is input by the user as a percentage from 0-100.00%) from decimal to integer in ignition. My thought was to read in the value of the input as a float, do the conversion to integer in a custom property, and then write the value of the property to the tag.

In my example, the user would input 84.55%. I convert that to 8455. Then write the integer to the PLC.

Is this possible or is there a better way to do this other than changing the type in the PLC?

PolyolFactorConversion custom property contains: toInt({Root Container.Container.PolyolFactor}\*100)

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

---

<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:** [November 2, 2022, 5:50pm UTC](https://forum.inductiveautomation.com/t/is-there-a-way-to-set-a-tag-value-to-the-value-of-a-custom-property-in-vision/66013/2 "2022-11-02T17:50:21Z")

</div>

[Tag Scaling](https://docs.inductiveautomation.com/display/DOC81/Tag+Scaling+Properties) or [Derived Tags](https://docs.inductiveautomation.com/display/DOC81/Types+of+Tags#TypesofTags-DerivedTags) might be easier to work with than custom property math?

---

<div class="post-metadata">

**Author:** ![IvanP](https://avatars.discourse-cdn.com/v4/letter/i/74df32/32.png) [@IvanP](https://forum.inductiveautomation.com/u/IvanP)\
**Post date:** [November 2, 2022, 6:04pm UTC](https://forum.inductiveautomation.com/t/is-there-a-way-to-set-a-tag-value-to-the-value-of-a-custom-property-in-vision/66013/3 "2022-11-02T18:04:22Z")

</div>

I tried scaling but I lose the decimal places to rounding. I will take a look at derived tags. Thanks!

---

<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:** [November 2, 2022, 6:04pm UTC](https://forum.inductiveautomation.com/t/is-there-a-way-to-set-a-tag-value-to-the-value-of-a-custom-property-in-vision/66013/4 "2022-11-02T18:04:24Z")

</div>

Definitely use tag scaling. Works in both directions. The Ignition tag can be float while the PLC tag is integer and it will **Just Work™**.

If you are losing decimal places then you have chosen proper min and max values.

---

<div class="post-metadata">

**Author:** ![IvanP](https://avatars.discourse-cdn.com/v4/letter/i/74df32/32.png) [@IvanP](https://forum.inductiveautomation.com/u/IvanP)\
**Post date:** [November 2, 2022, 6:32pm UTC](https://forum.inductiveautomation.com/t/is-there-a-way-to-set-a-tag-value-to-the-value-of-a-custom-property-in-vision/66013/5 "2022-11-02T18:32:28Z")

</div>

So these are the settings I've tried with scaling. Do you see what I may be doing wrong?

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

For example, if I enter 85.62 it rounds 86. The conversion is correct since it writes 8600 to the PLC tag, but it's still rounding off digits. If I can keep the value to 8562 I would be set but I haven't figured out how to do so with the scaling parameters given.

I really need to keep the decimal to the hundredths place.

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

---

<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:** [November 2, 2022, 6:35pm UTC](https://forum.inductiveautomation.com/t/is-there-a-way-to-set-a-tag-value-to-the-value-of-a-custom-property-in-vision/66013/6 "2022-11-02T18:35:10Z")

</div>

Try changing the tag's datatype from Integer to Float.

---

<div class="post-metadata">

**Author:** ![IvanP](https://avatars.discourse-cdn.com/v4/letter/i/74df32/32.png) [@IvanP](https://forum.inductiveautomation.com/u/IvanP)\
**Post date:** [November 2, 2022, 7:42pm UTC](https://forum.inductiveautomation.com/t/is-there-a-way-to-set-a-tag-value-to-the-value-of-a-custom-property-in-vision/66013/7 "2022-11-02T19:42:19Z")

</div>

You guys are awesome! That worked. Thanks again!!!
