Transforms: Null check without firstValid

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"

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:

{
    "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"
}
1 Like