# Convert tag int to string

**URL:** <https://forum.inductiveautomation.com/t/convert-tag-int-to-string/32476>\
**Category:** Ignition\
**Created:** [February 21, 2020, 12:15am UTC](https://forum.inductiveautomation.com/t/convert-tag-int-to-string/32476 "2020-02-21T00:15:23Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![NII](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/nii/32/12920_2.png) [@NII](https://forum.inductiveautomation.com/u/NII)\
**Post date:** [February 21, 2020, 12:15am UTC](https://forum.inductiveautomation.com/t/convert-tag-int-to-string/32476/1 "2020-02-21T00:15:23Z")

</div>

I have a string and an integer memory tag, I’d like to perform translation like:  
int tag str tag  
1 Hello  
2 Hi  
3 Bye  
etc.

Is it possible to do the above without scripting? If yes, how?

---

<div class="post-metadata">

**Author:** ![cmallonee](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/cmallonee/32/6416_2.png) [@cmallonee](https://forum.inductiveautomation.com/u/cmallonee)\
**Post date:** [February 21, 2020, 12:23am UTC](https://forum.inductiveautomation.com/t/convert-tag-int-to-string/32476/2 "2020-02-21T00:23:38Z")

</div>

It depends where you’re trying to do this and what version you’re using.

Ignition 8.0 or greater has Map transforms in bindings in which the Map takes discrete values and maps them to alternate values (complete with a fall back if no match is found). This would only output the value to some property somewhere, and would not write back to the tag.

---

<div class="post-metadata">

**Author:** ![b.ellison](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/b.ellison/32/12684_2.png) [@b.ellison](https://forum.inductiveautomation.com/u/b.ellison)\
**Post date:** [February 21, 2020, 12:50am UTC](https://forum.inductiveautomation.com/t/convert-tag-int-to-string/32476/3 "2020-02-21T00:50:47Z")

</div>

I would create a expression tag that uses this integer memory tag inside a case statement. The expression would be for example case(“tagpath”, 1, “Hello”, 2, “Hi”, 3, “Bye”, 4, “Etc.”, “Error”). (Error is a fallback, if a number comes back that is not within the case statement it will go back to the fallback value). You could also use this expression inside any page or popup instead of making another tag. Or You can use the map transforms mentioned above. Just thought i would provide another option.

---

<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:** [February 21, 2020, 1:09am UTC](https://forum.inductiveautomation.com/t/convert-tag-int-to-string/32476/4 "2020-02-21T01:09:39Z")

</div>

If you have many translations, consider using a static dataset memory tag with the two columns. Then your string expression tag(s) can use the lookup() function.

---

<div class="post-metadata">

**Author:** ![NII](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/nii/32/12920_2.png) [@NII](https://forum.inductiveautomation.com/u/NII)\
**Post date:** [February 21, 2020, 3:44am UTC](https://forum.inductiveautomation.com/t/convert-tag-int-to-string/32476/5 "2020-02-21T03:44:57Z")

</div>

Thanks for the responses, both b.ellison and pturmel work well.

---

<div class="post-metadata">

**Author:** ![JP.Tucker](https://avatars.discourse-cdn.com/v4/letter/j/96bed5/32.png) [@JP.Tucker](https://forum.inductiveautomation.com/u/JP.Tucker)\
**Post date:** [March 25, 2020, 3:45pm UTC](https://forum.inductiveautomation.com/t/convert-tag-int-to-string/32476/6 "2020-03-25T15:45:18Z")

</div>

I have this same issue, but have no clue what the expression should look like. I have an integer in the PLC that will drive what should be displayed from the string column the memory dataset. Can anyone give me an example of what the expression should be?

---

<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:** [March 25, 2020, 3:50pm UTC](https://forum.inductiveautomation.com/t/convert-tag-int-to-string/32476/7 "2020-03-25T15:50:36Z")

</div>

Best example you can find is in the manual: [https://docs.inductiveautomation.com/display/DOC80/lookup](https://docs.inductiveautomation.com/display/DOC80/lookup)
