# Change the text in a label on a time delay

**URL:** <https://forum.inductiveautomation.com/t/change-the-text-in-a-label-on-a-time-delay/63520>\
**Category:** Ignition\
**Tags:** scripting, ignition81\
**Created:** [August 26, 2022, 9:38pm UTC](https://forum.inductiveautomation.com/t/change-the-text-in-a-label-on-a-time-delay/63520 "2022-08-26T21:38:49Z")\
**Posts on this page:** 1\
**Showing post:** 14

<div class="post-metadata">

**Author:** ![jlandwerlen](https://avatars.discourse-cdn.com/v4/letter/j/bc8723/32.png) [@jlandwerlen](https://forum.inductiveautomation.com/u/jlandwerlen)\
**Post date:** [September 1, 2022, 2:00pm UTC](https://forum.inductiveautomation.com/t/change-the-text-in-a-label-on-a-time-delay/63520/14 "2022-09-01T14:00:31Z")

</div>

This is a crude example, uses expression and change script.

```auto
{
  "custom": {},
  "params": {},
  "props": {},
  "root": {
    "children": [
      {
        "events": {
          "component": {
            "onActionPerformed": {
              "config": {
                "script": "\tself.getSibling(\"Label\").custom.textTime \u003d system.date.now()"
              },
              "scope": "G",
              "type": "script"
            }
          }
        },
        "meta": {
          "name": "Button"
        },
        "position": {
          "height": 34,
          "width": 80,
          "x": 133,
          "y": 140
        },
        "type": "ia.input.button"
      },
      {
        "custom": {
          "textTime": {
            "$": [
              "ts",
              192,
              1662040678099
            ],
            "$ts": 1662040678098
          }
        },
        "meta": {
          "name": "Label"
        },
        "position": {
          "height": 32,
          "width": 234,
          "x": 262,
          "y": 142
        },
        "propConfig": {
          "custom.testReset": {
            "binding": {
              "config": {
                "expression": "(secondsBetween({this.custom.textTime}, now()) \u003e\u003d 5)"
              },
              "type": "expr"
            },
            "onChange": {
              "enabled": null,
              "script": "\tif currentValue.value:\n\t\tself.props.text \u003d \u0027Text reset\u0027\n\telse:\n\t\tself.props.text \u003d \u0027Button was pushed\u0027"
            }
          }
        },
        "props": {
          "text": "Text reset"
        },
        "type": "ia.display.label"
      }
    ],
    "meta": {
      "name": "root"
    },
    "type": "ia.container.coord"
  }
}

```

---

_[View the full topic](https://forum.inductiveautomation.com/t/change-the-text-in-a-label-on-a-time-delay/63520)._
