# Manager Update Transform Error

**URL:** <https://developer.sailpoint.com/discuss/t/manager-update-transform-error/56494>\
**Category:** SHF Discussion and Questions\
**Tags:** transforms, sailpoint-identity-security\
**Created:** [May 14, 2024, 4:52pm UTC](https://developer.sailpoint.com/discuss/t/manager-update-transform-error/56494 "2024-05-14T16:52:24Z")\
**Posts on this page:** 11\
**Page:** 1

<div class="post-metadata">

**Author:** ![VBsupport](https://avatars.discourse-cdn.com/v4/letter/v/ba9def/32.png) [@VBsupport](https://developer.sailpoint.com/discuss/u/VBsupport)\
**Post date:** [May 14, 2024, 4:52pm UTC](https://developer.sailpoint.com/discuss/t/manager-update-transform-error/56494/1 "2024-05-14T16:52:24Z")

</div>

Hello all,

We have hit a wall and need a little push to the finish line on this. Hopefully the great things i have heard within this community will be able to help as we are almost done but for this last min requirement. The code below is run in the identity profile on manager. When the user is onboarded if they do not have a manager yet in the field we put no manager and then get updated when added. How ever when the user is disabled in the system their manager gets removed and we need to keep that manager still in the field in IDN though the source removed it.

A simple static or conditional transforms by themself works fine but smash them together as it should I cannot get the field to display “Manager on first load” it keeps throwing out error

```json
{
    "id": "9ef708cf-0a8b-433d-930c-8ad30ba8095b",
    "name": "Manager Transform",
    "type": "static",
    "attributes": {
        "Manager": {
            "attributes": {
                "values": [
                    {
                        "attributes": {
                            "attributeName": "Manager ID",
                            "sourceName": "Manager Test Pull"
                        },
                        "type": "accountAttribute"
                    },
                    "No Manager"
                ]
            },
            "type": "firstValid"
        },
        "status": {
            "attributes": {
                "values": [
                    {
                        "attributes": {
                            "attributeName": "Status",
                            "sourceName": "Manager Test Pull"
                        },
                        "type": "accountAttribute"
                    },
                    "NONE"
                ]
            },
            "type": "firstValid"
        },
        "value": "#if($status == 'active')$Manager#elseif($status != 'inactive')$oldValue#else#end"
    },
    "internal": false
}

```

---

<div class="post-metadata">

**Author:** ![VBsupport](https://avatars.discourse-cdn.com/v4/letter/v/ba9def/32.png) [@VBsupport](https://developer.sailpoint.com/discuss/u/VBsupport)\
**Post date:** [May 14, 2024, 5:16pm UTC](https://developer.sailpoint.com/discuss/t/manager-update-transform-error/56494/2 "2024-05-14T17:16:26Z")

</div>

The Manager stays when the user goes inactive and is removed with the above code . The problem comes when a new person comes in without a manager it is erroring out and completing the profile build. What i need it to do is display “No Manager” first when the account is built and then update that field when its added later. after that the other code would kick in from the LCS of the user

 ![image](https://global.discourse-cdn.com/sailpoint/original/2X/9/9d8bd4a92b4d61377913c74e26c9cb3594e4dc34.png)

---

<div class="post-metadata">

**Author:** ![Gokul\_Ananth\_M\_08](https://sea1.discourse-cdn.com/sailpoint/discuss/user_avatar/developer.sailpoint.com/gokul_ananth_m_08/32/43615_2.png) [@Gokul\_Ananth\_M\_08](https://developer.sailpoint.com/discuss/u/Gokul_Ananth_M_08)\
**Post date:** [May 14, 2024, 6:50pm UTC](https://developer.sailpoint.com/discuss/t/manager-update-transform-error/56494/3 "2024-05-14T18:50:40Z")

</div>

> [@VBsupport](#):
>
> `"value": "#if($status == 'active')$Manager#elseif($status != 'inactive')$oldValue#else#end"`

You need to define the $oldValue in “value”.

State what’s the error message you received.

---

<div class="post-metadata">

**Author:** ![baoussounda](https://sea1.discourse-cdn.com/sailpoint/discuss/user_avatar/developer.sailpoint.com/baoussounda/32/13095_2.png) [@baoussounda](https://developer.sailpoint.com/discuss/u/baoussounda)\
**Post date:** [May 14, 2024, 6:53pm UTC](https://developer.sailpoint.com/discuss/t/manager-update-transform-error/56494/4 "2024-05-14T18:53:10Z")

</div>

What is your error message ?

In your expression

“value”: “#if($status == ‘active’)$Manager#elseif($status != ‘inactive’)$oldValue#else#end”

where do you define $oldValue ?

In the inactive user case wich value do you want to display ?

---

<div class="post-metadata">

**Author:** ![jrote01](https://avatars.discourse-cdn.com/v4/letter/j/a8b319/32.png) [@jrote01](https://developer.sailpoint.com/discuss/u/jrote01)\
**Post date:** [May 14, 2024, 6:54pm UTC](https://developer.sailpoint.com/discuss/t/manager-update-transform-error/56494/5 "2024-05-14T18:54:24Z")

</div>

The only thing that jumps out is the “Else” statement:  
#if($status == ‘active’)$Manager#elseif($status != ‘inactive’)$oldValue#else#end

In the case the “Manager Test Pull” account is not mapped or the status does not match “active” or “inactive”, it would likely error out.

---

<div class="post-metadata">

**Author:** ![VBsupport](https://avatars.discourse-cdn.com/v4/letter/v/ba9def/32.png) [@VBsupport](https://developer.sailpoint.com/discuss/u/VBsupport)\
**Post date:** [May 14, 2024, 8:47pm UTC](https://developer.sailpoint.com/discuss/t/manager-update-transform-error/56494/6 "2024-05-14T20:47:52Z")

</div>

I did some rework and have it all working but for getting the “No manager” to display when there is none when user is active. I will always show the current or past manager when they are active or inactive which is what is expected. Right now it comes in blank when a new user comes in and has no manager yet which needs to be displayed as “No manager”

“name”: “Manager Name Rework”,  
“type”: “static”,  
“attributes”: {  
“ignoreErrors”: “true”,  
“value”: “#if($status==‘inactive’)manager#{elseif}($manager != "NM")$manager#{end}”,  
“status”: {  
“type”: “accountAttribute”,  
“attributes”: {  
“attributeName”: “Status”,  
“sourceName”: “Manager Test Pull”  
}  
},  
“manager”: {  
“type”: “firstValid”,  
“attributes”: {  
“values”: [  
{  
“type”: “rule”,  
“attributes”: {  
“attributeName”: “managerid”,  
“name”: “Cloud Services Deployment Utility”,  
“operation”: “getReferenceIdentityAttribute”,  
“uid”: “manager”  
},  
“ignoreErrors”: “true”  
},  
{  
“type”: “static”,  
“attributes”: {  
“value”: “NM”  
}  
}  
]  
},  
“ignoreErrors”: “true”  
}  
},  
“internal”: false

---

<div class="post-metadata">

**Author:** ![baoussounda](https://sea1.discourse-cdn.com/sailpoint/discuss/user_avatar/developer.sailpoint.com/baoussounda/32/13095_2.png) [@baoussounda](https://developer.sailpoint.com/discuss/u/baoussounda)\
**Post date:** [May 14, 2024, 10:41pm UTC](https://developer.sailpoint.com/discuss/t/manager-update-transform-error/56494/7 "2024-05-14T22:41:37Z")

</div>

> [@VBsupport](#):
>
> Right now it comes in blank when a new user comes in and has no manager yet which needs to be displayed as “No manager”

Helle @VBsupport,

i update your transform if you can test it :

```auto
{
    "name": "Manager Name Rework",
    "type": "static",
    "attributes": {
        "ignoreErrors": "true",
        "value": "#if($status==‘inactive’)manager#{else}$manager#{end}",
        "status": {
            "type": "accountAttribute",
            "attributes": {
                "attributeName": "Status",
                "sourceName": "Manager Test Pull"
            }
        },
        "manager": {
            "type": "firstValid",
            "attributes": {
                "values": [
                    {
                        "type": "rule",
                        "attributes": {
                            "attributeName": "managerid",
                            "name": "Cloud Services Deployment Utility",
                            "operation": "getReferenceIdentityAttribute",
                            "uid": "manager"
                        },
                        "ignoreErrors": "true"
                    },
                    {
                        "type": "static",
                        "attributes": {
                            "value": "NM"
                        }
                    }
                ]
            },
            "ignoreErrors": "true"
        }
    },
    "internal": false
}

```

---

<div class="post-metadata">

**Author:** ![VBsupport](https://avatars.discourse-cdn.com/v4/letter/v/ba9def/32.png) [@VBsupport](https://developer.sailpoint.com/discuss/u/VBsupport)\
**Post date:** [May 14, 2024, 11:52pm UTC](https://developer.sailpoint.com/discuss/t/manager-update-transform-error/56494/8 "2024-05-14T23:52:48Z")

</div>

this is throwing a error as below.  
The code i had before is working and for inactive and null values however all i need to do is be able to add the wording " No Manager" when the user is active and does not have a manager

Use case

1. When a user becomes “inactive”, they need to keep the manager they have while the source has removed its manager value.
2. When a user is onboarded, they may not have a manager so when they are active but have no manager the blank field need to display “No Manager” until it is updated at the source with a manager which then would replace the “no manager” with the new correct value

Error:  
There was an exception while calculating the value for this attribute. Error rendering template: #if($status==‘inactive’)manager#{else}$manager#{end}

---

<div class="post-metadata">

**Author:** ![Gokul\_Ananth\_M\_08](https://sea1.discourse-cdn.com/sailpoint/discuss/user_avatar/developer.sailpoint.com/gokul_ananth_m_08/32/43615_2.png) [@Gokul\_Ananth\_M\_08](https://developer.sailpoint.com/discuss/u/Gokul_Ananth_M_08)\
**Post date:** [May 15, 2024, 5:01am UTC](https://developer.sailpoint.com/discuss/t/manager-update-transform-error/56494/9 "2024-05-15T05:01:10Z")

</div>

Take a look at the links provided below, which may be helpful to you. [First Valid | SailPoint Developer Community](https://developer.sailpoint.com/docs/extensibility/transforms/operations/first-valid/)

> [@Transform firstValid: ignoreErrors default value](https://developer.sailpoint.com/discuss/t/transform-firstvalid-ignoreerrors-default-value/22665):
>
> Dear SailPoint IDN Documentation Team, For the transform firstValid ( [First Valid | SailPoint Developer Community](https://developer.sailpoint.com/idn/docs/transforms/operations/first-valid/) ), attribute ignoreErrors we have the following description (no default value is specified): ignoreErrors - This true or false value indicates whether to proceed to the next option if an error (like an NPE) occurs. and below at the examples: Without ignoreErrors set to true, this transform throws a null pointer exception (NPE) for any user without a manager. With ignoreErrors …

I don’t see any issues with @baoussounda . I have just removed all the “ignoreErrors” as it’s default value is true.

```auto
{
    "name": "Manager Name Rework",
    "type": "static",
    "attributes": {
        "ignoreErrors": "true",
        "value": "#if($status=='inactive')manager#{else}$manager#end",
        "status": {
            "type": "accountAttribute",
            "attributes": {
                "attributeName": "Status",
                "sourceName": "Manager Test Pull"
            }
        },
        "manager": {
            "type": "firstValid",
            "attributes": {
                "values": [
                    {
                        "type": "rule",
                        "attributes": {
                            "attributeName": "managerid",
                            "name": "Cloud Services Deployment Utility",
                            "operation": "getReferenceIdentityAttribute",
                            "uid": "manager"
                        }
                    },
                    "No Manager"
                ]
            }
        }
    },
    "internal": false
}

```

---

<div class="post-metadata">

**Author:** ![VBsupport](https://avatars.discourse-cdn.com/v4/letter/v/ba9def/32.png) [@VBsupport](https://developer.sailpoint.com/discuss/u/VBsupport)\
**Post date:** [May 15, 2024, 11:33am UTC](https://developer.sailpoint.com/discuss/t/manager-update-transform-error/56494/10 "2024-05-15T11:33:31Z")

</div>

Thank you everyone and GOKUL on the 3rd eye. It is awesome to have such a great group of people helping for the greater good of each other. Please feel free to reach out if you need help as well

---

<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 14, 2024, 11:33am UTC](https://developer.sailpoint.com/discuss/t/manager-update-transform-error/56494/11 "2024-07-14T11:33:43Z")

</div>

Closed on July 14, 2024, 11:33am UTC

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.
