# Define expression from a string parameter

**URL:** <https://forum.inductiveautomation.com/t/define-expression-from-a-string-parameter/58327>\
**Category:** Ignition\
**Tags:** ignition80\
**Created:** [April 11, 2022, 8:57pm UTC](https://forum.inductiveautomation.com/t/define-expression-from-a-string-parameter/58327 "2022-04-11T20:57:16Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![kgamble](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/kgamble/32/8019_2.png) [@kgamble](https://forum.inductiveautomation.com/u/kgamble)\
**Post date:** [April 11, 2022, 8:57pm UTC](https://forum.inductiveautomation.com/t/define-expression-from-a-string-parameter/58327/1 "2022-04-11T20:57:16Z")

</div>

I need to evaluate some dynamically defined expressions, that are created outside of the tag editor.

I am fairly certain I could do it with a `system.tag.configure` and then just define the expression there,

However would it be possible to define the expression in a UDT parameter and then evaluate it inside the expression editor?

Something to the affect of `expression({expressionParam}, 5000)` or is that just wishful thinking? Where `expressionParam = toMillis(now(5000))` or something similar.

I think I could just use `runScript` here and python instead, but that feels dirtier than an expression for some reason.

---

<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:** [April 11, 2022, 9:53pm UTC](https://forum.inductiveautomation.com/t/define-expression-from-a-string-parameter/58327/2 "2022-04-11T21:53:34Z")

</div>

Pretty sure you crash into a wall here. I’ll bet system.tag.configure will want the _compiled_ expression, which you cannot generate. Let us know if you find different.

---

<div class="post-metadata">

**Author:** ![kgamble](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/kgamble/32/8019_2.png) [@kgamble](https://forum.inductiveautomation.com/u/kgamble)\
**Post date:** [April 11, 2022, 9:58pm UTC](https://forum.inductiveautomation.com/t/define-expression-from-a-string-parameter/58327/3 "2022-04-11T21:58:56Z")

</div>

Crude test, but this worked

```auto
tag = {
  "valueSource": "expr",
  "expression": "toMillis(now(5000))",
  "dataType": "Int8",
  "name": "New Tag",
  "tagType": "AtomicTag"
}

system.tag.configure("Test", tag)

```
