# Field 'alertExpressionSource' is required

**URL:** <https://forum.inductiveautomation.com/t/field-alertexpressionsource-is-required/4107>\
**Category:** Ignition\
**Created:** [March 6, 2012, 4:48pm UTC](https://forum.inductiveautomation.com/t/field-alertexpressionsource-is-required/4107 "2012-03-06T16:48:37Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![ecujak](https://avatars.discourse-cdn.com/v4/letter/e/839c29/32.png) [@ecujak](https://forum.inductiveautomation.com/u/ecujak)\
**Post date:** [March 6, 2012, 4:48pm UTC](https://forum.inductiveautomation.com/t/field-alertexpressionsource-is-required/4107/1 "2012-03-06T16:48:37Z")

</div>

[size=150][color=#FF0000]Field ‘alertExpressionSource’ is required.[/color][/size]

I see this but there isn’t documentation for this in the manual.

I am trying to set up a Distribution alert. Having trouble with setting up the expression in the group. Looks like there is a lot of potential here for what I want to do, but I just don’t know where to start.

It is mentioned in the links below but is never explained and no example given. I really wish we would expand on the documentation of features in the manuals before expanding on anything else. Examples please…

[inductiveautomation.com/supp … erties.htm](http://www.inductiveautomation.com/support/usermanuals/ignition/index.html?alerting_properties.htm)

[inductiveautomation.com/supp … erties.htm](http://www.inductiveautomation.com/support/usermanuals/ignition/index.html?alerting_properties.htm)

---

<div class="post-metadata">

**Author:** ![ecujak](https://avatars.discourse-cdn.com/v4/letter/e/839c29/32.png) [@ecujak](https://forum.inductiveautomation.com/u/ecujak)\
**Post date:** [March 6, 2012, 5:31pm UTC](https://forum.inductiveautomation.com/t/field-alertexpressionsource-is-required/4107/2 "2012-03-06T17:31:46Z")

</div>

So what would I like the expression to resolve?

If I could fire this email distro for the following case:

Has a tag path Fulton/Fulton temp where severity is high

or

Has a tag path Oil/Oil Level where severity is high

or  
(  
Has a tag path Hydro/Pressure where severity is high  
and  
Has a tag path Hydro/Temp where severity is high  
)  
Or  
… and so on… any other scripting options or flow logic examples would be nice as well.

---

<div class="post-metadata">

**Author:** ![ecujak](https://avatars.discourse-cdn.com/v4/letter/e/839c29/32.png) [@ecujak](https://forum.inductiveautomation.com/u/ecujak)\
**Post date:** [March 6, 2012, 6:38pm UTC](https://forum.inductiveautomation.com/t/field-alertexpressionsource-is-required/4107/3 "2012-03-06T18:38:15Z")

</div>

can someone just copy and past an example for their most advanced distro group expression?

---

<div class="post-metadata">

**Author:** ![Colby.Clegg](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/colby.clegg/32/3282_2.png) [@Colby.Clegg](https://forum.inductiveautomation.com/u/Colby.Clegg)\
**Post date:** [March 6, 2012, 7:16pm UTC](https://forum.inductiveautomation.com/t/field-alertexpressionsource-is-required/4107/4 "2012-03-06T19:16:22Z")

</div>

That error is admittedly not very helpful, but basically what it’s saying is that you’re leaving the expression field blank.

You can improve the process of editing distribution groups a bit by importing [this useful window](http://inductiveautomation.com/forum/download/file.php?id=792) that allows you to edit the group in a project.

As for the syntax, it’s the same as the [expression language](http://inductiveautomation.com/support/usermanuals/ignition/syntax_expressions.htm), with the addition of certain additional items that you can reference, like the tag path. The possible fields are the same as those defined for [custom alert messages](http://inductiveautomation.com/support/usermanuals/ignition/alerting_properties.htm)  
(Note: Don’t worry, we’re well aware that the user manual needs to be improved. Addressing usability issues and the user manual is our next top priority.)

Severity (referenced by {[SEVERITY]}) can be used like a number, 0 (low)-4(high). So, you could do something like what you asked with the following (note: something like “tagpath=x and tagpath=y” doesn’t make sense, since the expression is evaluated for each alert that comes through):

```auto
{[SEVERITY]}=4 && ({[ITEM_PATH]} like '%Fulton/Fulton temp' || {[ITEM_PATH]} like '%Oil/Oil Level')
```

Basically, since all of your conditions where based on high severity, we check that first, and then check a list of tag paths. I used “like” with a wild card on the front to make it insensitive to the tag provider name.

Hopefully others will post examples of their distro group expressions.

Regards,

---

<div class="post-metadata">

**Author:** ![ecujak](https://avatars.discourse-cdn.com/v4/letter/e/839c29/32.png) [@ecujak](https://forum.inductiveautomation.com/u/ecujak)\
**Post date:** [March 6, 2012, 7:47pm UTC](https://forum.inductiveautomation.com/t/field-alertexpressionsource-is-required/4107/5 "2012-03-06T19:47:05Z")

</div>

```auto
({[ITEM_PATH]} like '%Fulton/Fulton temp' && {[SEVERITY]}=4 ) || ({[ITEM_PATH]} like '%Oil/Oil Level' && {[SEVERITY]}>1)
```

Thanks Colby.

What I was trying to get at with [quote] something like “tagpath=x and tagpath=y” [/quote] was only sending an email if two specific alerts were active at a specific time. So if x was already active and y fired this event then it would send the email.

---

<div class="post-metadata">

**Author:** ![ecujak](https://avatars.discourse-cdn.com/v4/letter/e/839c29/32.png) [@ecujak](https://forum.inductiveautomation.com/u/ecujak)\
**Post date:** [March 6, 2012, 7:57pm UTC](https://forum.inductiveautomation.com/t/field-alertexpressionsource-is-required/4107/6 "2012-03-06T19:57:03Z")

</div>

Error inserting new group.  
String or binary data would be truncated.  
See log for details.

What is the maximum length for this expression?

---

<div class="post-metadata">

**Author:** ![Colby.Clegg](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/colby.clegg/32/3282_2.png) [@Colby.Clegg](https://forum.inductiveautomation.com/u/Colby.Clegg)\
**Post date:** [March 6, 2012, 10:28pm UTC](https://forum.inductiveautomation.com/t/field-alertexpressionsource-is-required/4107/7 "2012-03-06T22:28:51Z")

</div>

Doh. I hate when difficulty get compounded with weird problem. Anyhow, what’s going on is that the expression column is being made as a varchar (and probably limited to 255). You’ll need to update the column in the db to accept more (just like on that other thread by someone else with a similar problem, where you asked for an example… so you might already be onto this).

To give an exact answer, we’ll need to know which db system you’re using.

Regards,

---

<div class="post-metadata">

**Author:** ![Colby.Clegg](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/colby.clegg/32/3282_2.png) [@Colby.Clegg](https://forum.inductiveautomation.com/u/Colby.Clegg)\
**Post date:** [March 8, 2012, 4:43pm UTC](https://forum.inductiveautomation.com/t/field-alertexpressionsource-is-required/4107/8 "2012-03-08T16:43:57Z")

</div>

Don’t know if you’ve gotten a chance to look at this, but thought I would post the fix for mysql at least. If using something else, you’ll just need to find the correct “long text” data type for that DB.

```auto
alter table alert_distro_groups modify column expression text;
```

Regards,
