# Switching label text between two parameters

**URL:** <https://forum.inductiveautomation.com/t/switching-label-text-between-two-parameters/75655>\
**Category:** Ignition\
**Tags:** ignition81, perspective, scripting, python\
**Created:** [June 28, 2023, 3:29pm UTC](https://forum.inductiveautomation.com/t/switching-label-text-between-two-parameters/75655 "2023-06-28T15:29:03Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![pbg](https://avatars.discourse-cdn.com/v4/letter/p/ecd19e/32.png) [@pbg](https://forum.inductiveautomation.com/u/pbg)\
**Post date:** [June 28, 2023, 3:29pm UTC](https://forum.inductiveautomation.com/t/switching-label-text-between-two-parameters/75655/1 "2023-06-28T15:29:03Z")

</div>

Hi, I have parameters in my root and I have a label component which I'd like to display the value of those parameters in the label text. I would like the text to alternate between one value and another value at a fixed rate, essentially flashing between the two texts.

I've tried working with expression binding the two params and then using transforms scripts but thus far I can't get a solution.

---

<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:** [June 28, 2023, 3:54pm UTC](https://forum.inductiveautomation.com/t/switching-label-text-between-two-parameters/75655/2 "2023-06-28T15:54:21Z")

</div>

Perhaps an expression binding like this:

```auto
if((toMillis(now(500)) / 500) % 2, {path.to.first.param}, {path.to.second.param})

```

Make the update pace for `now()` match the divisor.

---

<div class="post-metadata">

**Author:** ![pbg](https://avatars.discourse-cdn.com/v4/letter/p/ecd19e/32.png) [@pbg](https://forum.inductiveautomation.com/u/pbg)\
**Post date:** [June 29, 2023, 5:35pm UTC](https://forum.inductiveautomation.com/t/switching-label-text-between-two-parameters/75655/3 "2023-06-29T17:35:10Z")

</div>

That works amazingly! You wouldn't happen to have any ideas for more than two params?

---

<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:** [June 29, 2023, 5:39pm UTC](https://forum.inductiveautomation.com/t/switching-label-text-between-two-parameters/75655/4 "2023-06-29T17:39:22Z")

</div>

Use [case()](https://docs.inductiveautomation.com/display/DOC81/case) instead of `if()`, and a larger modulus.
