# \[SOLVED\] Text field component

**URL:** <https://forum.inductiveautomation.com/t/solved-text-field-component/59750>\
**Category:** Ignition\
**Tags:** vision, ignition81\
**Created:** [May 18, 2022, 9:13pm UTC](https://forum.inductiveautomation.com/t/solved-text-field-component/59750 "2022-05-18T21:13:19Z")\
**Posts on this page:** 15\
**Page:** 1

<div class="post-metadata">

**Author:** ![Esmeralda\_Lopez](https://avatars.discourse-cdn.com/v4/letter/e/fbc32d/32.png) [@Esmeralda\_Lopez](https://forum.inductiveautomation.com/u/Esmeralda_Lopez)\
**Post date:** [May 18, 2022, 9:13pm UTC](https://forum.inductiveautomation.com/t/solved-text-field-component/59750/1 "2022-05-18T21:13:19Z")

</div>

Hello, I want to change the value of a tag to display in a label , how can I do that ?  
Like set or update for another word :

Connected = ready

---

<div class="post-metadata">

**Author:** ![pascal.fragnoud](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/pascal.fragnoud/32/24728_2.png) [@pascal.fragnoud](https://forum.inductiveautomation.com/u/pascal.fragnoud)\
**Post date:** [May 18, 2022, 9:25pm UTC](https://forum.inductiveautomation.com/t/solved-text-field-component/59750/2 "2022-05-18T21:25:41Z")

</div>

I’m… confused. Can you try to be clearer/more specific ?

---

<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:** [May 18, 2022, 9:26pm UTC](https://forum.inductiveautomation.com/t/solved-text-field-component/59750/3 "2022-05-18T21:26:50Z")

</div>

In Vision, the best way to do this is probably via the style customizer. Add a custom property to the label. Bind it to the tag in question. Give the component styles, driven by this custom property, which can include changing the text.

[https://docs.inductiveautomation.com/display/DOC81/Vision+Component+Customizers#VisionComponentCustomizers-StyleCustomizer](https://docs.inductiveautomation.com/display/DOC81/Vision+Component+Customizers#VisionComponentCustomizers-StyleCustomizer)

---

<div class="post-metadata">

**Author:** ![Esmeralda\_Lopez](https://avatars.discourse-cdn.com/v4/letter/e/fbc32d/32.png) [@Esmeralda\_Lopez](https://forum.inductiveautomation.com/u/Esmeralda_Lopez)\
**Post date:** [May 18, 2022, 9:29pm UTC](https://forum.inductiveautomation.com/t/solved-text-field-component/59750/4 "2022-05-18T21:29:53Z")

</div>

But is an string

---

<div class="post-metadata">

**Author:** ![Transistor](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/transistor/32/3380_2.png) [@Transistor](https://forum.inductiveautomation.com/u/Transistor)\
**Post date:** [May 18, 2022, 9:39pm UTC](https://forum.inductiveautomation.com/t/solved-text-field-component/59750/5 "2022-05-18T21:39:58Z")

</div>

Please explain what the input values are and what you want to display in each case. Draw a table using the `</>` code formatting button like this:

```auto
Tag | Label text
========|==========================
'Go' | 'Running'
'NoGo' | 'Stopped'
'eStop' | 'Emergency stop pressed'
 etc. | ...

```

---

<div class="post-metadata">

**Author:** ![Esmeralda\_Lopez](https://avatars.discourse-cdn.com/v4/letter/e/fbc32d/32.png) [@Esmeralda\_Lopez](https://forum.inductiveautomation.com/u/Esmeralda_Lopez)\
**Post date:** [May 18, 2022, 10:17pm UTC](https://forum.inductiveautomation.com/t/solved-text-field-component/59750/6 "2022-05-18T22:17:38Z")

</div>

the string that the tag return is Connected, I need it to display “New alarm” in the label, that is all

---

<div class="post-metadata">

**Author:** ![Transistor](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/transistor/32/3380_2.png) [@Transistor](https://forum.inductiveautomation.com/u/Transistor)\
**Post date:** [May 18, 2022, 10:25pm UTC](https://forum.inductiveautomation.com/t/solved-text-field-component/59750/7 "2022-05-18T22:25:09Z")

</div>

> [@Esmeralda\_Lopez](#):
>
> the string that the tag return is Connected

There has to be at least two states! Otherwise what is the point of having the tag?

Anyway, I think you are looking for an **Expresson Binding**.

 ![Connected](https://us1.discourse-cdn.com/inductiveautomation/original/3X/5/1/5139e79e1a2f32a65673ce825b256b1ecb737dcc.png)

---

<div class="post-metadata">

**Author:** ![Esmeralda\_Lopez](https://avatars.discourse-cdn.com/v4/letter/e/fbc32d/32.png) [@Esmeralda\_Lopez](https://forum.inductiveautomation.com/u/Esmeralda_Lopez)\
**Post date:** [May 18, 2022, 10:28pm UTC](https://forum.inductiveautomation.com/t/solved-text-field-component/59750/8 "2022-05-18T22:28:21Z")

</div>

Fault is the second state as something wrong happen

---

<div class="post-metadata">

**Author:** ![Transistor](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/transistor/32/3380_2.png) [@Transistor](https://forum.inductiveautomation.com/u/Transistor)\
**Post date:** [May 18, 2022, 10:30pm UTC](https://forum.inductiveautomation.com/t/solved-text-field-component/59750/9 "2022-05-18T22:30:26Z")

</div>

Why didn’t you draw the table as requested? What is to be displayed when “Fault” is received? Can you see how difficult it is to help you?

---

<div class="post-metadata">

**Author:** ![Esmeralda\_Lopez](https://avatars.discourse-cdn.com/v4/letter/e/fbc32d/32.png) [@Esmeralda\_Lopez](https://forum.inductiveautomation.com/u/Esmeralda_Lopez)\
**Post date:** [May 18, 2022, 10:55pm UTC](https://forum.inductiveautomation.com/t/solved-text-field-component/59750/10 "2022-05-18T22:55:56Z")

</div>

```auto
Tag | Label text
===============|==========================
'Connected' | 'New value'
'Fault' | 'Something wrong'
```

---

<div class="post-metadata">

**Author:** ![Esmeralda\_Lopez](https://avatars.discourse-cdn.com/v4/letter/e/fbc32d/32.png) [@Esmeralda\_Lopez](https://forum.inductiveautomation.com/u/Esmeralda_Lopez)\
**Post date:** [May 18, 2022, 11:08pm UTC](https://forum.inductiveautomation.com/t/solved-text-field-component/59750/11 "2022-05-18T23:08:00Z")

</div>

And if I want to change the background color depending if :

```auto
Tag | Label text
===============|==========================
'Connected' | 'New value' GREEN
'Fault' | 'Something wrong' RED

```

---

<div class="post-metadata">

**Author:** ![nminchin](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/nminchin/32/6911_2.png) [@nminchin](https://forum.inductiveautomation.com/u/nminchin)\
**Post date:** [May 19, 2022, 3:28am UTC](https://forum.inductiveautomation.com/t/solved-text-field-component/59750/12 "2022-05-19T03:28:08Z")

</div>

> [@Transistor](#):
>
> Can you see how difficult it is to help you?

For some, perhaps. Maybe you should get better at mind reading? Jeez 😮‍💨

---

<div class="post-metadata">

**Author:** ![nminchin](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/nminchin/32/6911_2.png) [@nminchin](https://forum.inductiveautomation.com/u/nminchin)\
**Post date:** [May 19, 2022, 3:30am UTC](https://forum.inductiveautomation.com/t/solved-text-field-component/59750/13 "2022-05-19T03:30:08Z")

</div>

> [@Esmeralda\_Lopez](#):
>
> And if I want to change the background color depending if :

Either use the same expression on the background fill and substitute "New value" and "Something wrong" for colours like `color(0,255,0)` and `color(255,0,0)`, or you could go back to @paul-griffith 's answer and use a style customiser

---

<div class="post-metadata">

**Author:** ![Transistor](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/transistor/32/3380_2.png) [@Transistor](https://forum.inductiveautomation.com/u/Transistor)\
**Post date:** [May 19, 2022, 5:58am UTC](https://forum.inductiveautomation.com/t/solved-text-field-component/59750/14 "2022-05-19T05:58:19Z")

</div>

Define the problem first:

```auto
Tag | Label text | Label color
===============|==================|==========
'Connected' | 'New value' | GREEN
'Fault' | 'Something wrong'| RED

```

Now it should be clear that you will require a second binding.

 ![Vision background color binding](https://us1.discourse-cdn.com/inductiveautomation/original/3X/4/e/4e77f0c4bb86e1c52a110ba13a6c5ba67285764a.png)

---

<div class="post-metadata">

**Author:** ![Esmeralda\_Lopez](https://avatars.discourse-cdn.com/v4/letter/e/fbc32d/32.png) [@Esmeralda\_Lopez](https://forum.inductiveautomation.com/u/Esmeralda_Lopez)\
**Post date:** [May 19, 2022, 6:15pm UTC](https://forum.inductiveautomation.com/t/solved-text-field-component/59750/15 "2022-05-19T18:15:09Z")

</div>

thanks, that worked!
