# Expression Help. Coalesce Null value

**URL:** <https://forum.inductiveautomation.com/t/expression-help-coalesce-null-value/29301>\
**Category:** Ignition Early Access\
**Tags:** perspective\
**Created:** [October 22, 2019, 8:53pm UTC](https://forum.inductiveautomation.com/t/expression-help-coalesce-null-value/29301 "2019-10-22T20:53:59Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![wking](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/wking/32/21823_2.png) [@wking](https://forum.inductiveautomation.com/u/wking)\
**Post date:** [October 22, 2019, 8:53pm UTC](https://forum.inductiveautomation.com/t/expression-help-coalesce-null-value/29301/1 "2019-10-22T20:53:59Z")

</div>

Hey y’all

I have an expression:

`substring({.../lotone/lot.props.text},0,9) + (toint(substring({.../lotone/lot.props.text},"10")) + toint(substring({.../lottwo/lot.props.text},"10")) +100+ toint(substring({.../lotthree/lot.props.text},"10")))`

That works with all three properties great!

 ![three](https://us1.discourse-cdn.com/inductiveautomation/original/2X/b/b37af39ebcccc8df4695b5268f2cee9a545dd2cd.jpeg)

I got the count to work with two or three by coalesce.

![two](https://us1.discourse-cdn.com/inductiveautomation/original/2X/b/ba6aeb285d207d52ca3c970d6d4f49ac7fa13989.jpeg)  
the following:

```auto
toint({.../lotone/count.props.text}) + 
toint({.../lottwo/count.props.text}) + 
coalesce(toint({.../lotthree/count.props.text},0))

```

I need to do the same with the lots but can’t figure out how to call three functions: toInt the substring then coalesce or whatever. The function takes the digits after the 10th digit. and adds them up and adds an additional 100 and sticks that on to the first 9 digits and makes a new lot number. We know anything with a 1XX is a “merged lot”

I’ve tried several different ways

```auto
substring({.../lotone/lot.props.text},0,9) + (toint(substring({.../lotone/lot.props.text},"10")) + toint(substring({.../lottwo/lot.props.text},"10")) +100+ coalesce(toint(substring({.../lotthree/lot.props.text},"10"))))

```

I guess the broader question is can and if so how do you setup args for nested functions. I’ve had my nose in docs but no such luck… Thanks as always!

---

<div class="post-metadata">

**Author:** ![wking](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/wking/32/21823_2.png) [@wking](https://forum.inductiveautomation.com/u/wking)\
**Post date:** [October 22, 2019, 9:28pm UTC](https://forum.inductiveautomation.com/t/expression-help-coalesce-null-value/29301/2 "2019-10-22T21:28:16Z")

</div>

```auto
substring({.../lotone/lot.props.text},0,9) +
(toint(substring({.../lotone/lot.props.text},"10")) + 
toint(substring({.../lottwo/lot.props.text},"10")) +100 + try(toint(substring({.../lotthree/lot.props.text},"10")),-1))

```
