# Transforms: Null check without firstValid

**URL:** <https://developer.sailpoint.com/discuss/t/transforms-null-check-without-firstvalid/10504>\
**Category:** SHF Discussion and Questions\
**Tags:** transforms\
**Created:** [April 21, 2023, 3:18pm UTC](https://developer.sailpoint.com/discuss/t/transforms-null-check-without-firstvalid/10504 "2023-04-21T15:18:01Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![hearst2k](https://avatars.discourse-cdn.com/v4/letter/h/41988e/32.png) [@hearst2k](https://developer.sailpoint.com/discuss/u/hearst2k)\
**Post date:** [April 21, 2023, 3:18pm UTC](https://developer.sailpoint.com/discuss/t/transforms-null-check-without-firstvalid/10504/1 "2023-04-21T15:18:01Z")

</div>

Is there a simpler way to do a Null Check without firstValid? I am looking at something like a static transform, with value as:  
`"#if($identity.manager != null)$identity.manager.attributes.displayName#end"`

---

<div class="post-metadata">

**Author:** ![justinrhaines](https://sea1.discourse-cdn.com/sailpoint/discuss/user_avatar/developer.sailpoint.com/justinrhaines/32/16564_2.png) [@justinrhaines](https://developer.sailpoint.com/discuss/u/justinrhaines)\
**Post date:** [April 24, 2023, 7:51pm UTC](https://developer.sailpoint.com/discuss/t/transforms-null-check-without-firstvalid/10504/2 "2023-04-24T19:51:24Z")

</div>

I usually populate a variable value with a firstValid transform to avoid getting null values, which consistently throw an error in my experience. For example:

```auto
{
    "attributes": {
        "OU": {
            "attributes": {
                "values": [
                    {
                        "attributes": {
                        "name": "manager"
                            },
                            "type": "identityAttribute"
                    },
                    {
                        "attributes": {
                                            "value": "blank"
                                        },
                        "type": "static"
                    }
                ]
            },
            "type": "firstValid"
        },
        "value": "#if($OU!='blank')$identity.manager.attributes.distinguishedname.substring($identity.manager.attributes.distinguishedname.indexOf('OU',0),$identity.manager.attributes.distinguishedname.length())#{else}No OU Available#end"
    },
    "id": "AD OU",
    "type": "static"
}

```

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/sailpoint/original/2X/f/f2136700ed5e3703e0b85e02f6be799dacca7735.png) [@system](https://developer.sailpoint.com/discuss/u/system)\
**Post date:** [July 19, 2023, 2:24pm UTC](https://developer.sailpoint.com/discuss/t/transforms-null-check-without-firstvalid/10504/3 "2023-07-19T14:24:52Z")

</div>

Closed on July 19, 2023, 2:24pm UTC


