# Issue in Transform

**URL:** <https://developer.sailpoint.com/discuss/t/issue-in-transform/21831>\
**Category:** SHF Discussion and Questions\
**Tags:** transforms, identity-security-cloud\
**Created:** [December 1, 2023, 12:50pm UTC](https://developer.sailpoint.com/discuss/t/issue-in-transform/21831 "2023-12-01T12:50:49Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![Harish\_accenture](https://avatars.discourse-cdn.com/v4/letter/h/ce73a5/32.png) [@Harish\_accenture](https://developer.sailpoint.com/discuss/u/Harish_accenture)\
**Post date:** [December 1, 2023, 12:50pm UTC](https://developer.sailpoint.com/discuss/t/issue-in-transform/21831/1 "2023-12-01T12:50:49Z")

</div>

Hi.

This transform is not working after adding the “lifecycle” . Getting “exception while calculating the value for this attribute”.

{

```
"name": "UserLevel",
"type": "static",
"attributes": {
    "studentLevel": {
        "attributes": {
            "sourceName": "Student Banner replica",
            "attributeName": "STUDENT_LEVEL"
        },
        "type": "accountAttribute"
    },
    "status": {
        "attributes": {
            "sourceName": "Student Banner replica",
            "attributeName": "STUDENT_STATUS"
        },
        "type": "accountAttribute"
    },
    "levelCode": {
        "attributes": {
            "values": [
                {
                    "attributes": {
                        "attributeName": "STUDENT_YEAR_CODE",
                        "sourceName": "Student Banner replica"
                    },
                    "type": "accountAttribute"
                },
                {
                    "attributes": {
                        "value": "blank"
                    },
                    "type": "static"
                }
            ]
        },
        "type": "firstValid"
    },
    "lifecycle": {
        "attributes": {
            "values": [
                {
                    "attributes": {
                        "attributeName": "cloudLifecycleState"
                    },
                    "type": "identityAttribute"
                },
                {
                    "attributes": {
                        "value": "blank"
                    },
                    "type": "static"
                }
            ]
        },
        "type": "firstValid"
    },
    "value": "#if(($studentLevel=='MD' || $studentLevel=='DE') && ($levelCode.startsWith('01') || $levelCode.startsWith('02') || $levelCode.startsWith('03') || $levelCode.startsWith('04') || $levelCode.startsWith('05') || $levelCode.startsWith('06') || $levelCode.startsWith('07') || $levelCode.startsWith('08') || $levelCode.startsWith('09')) && $levelCode != '99')U/G Year #if($levelCode.contains('0'))$levelCode.replace('0','')#{else}$levelCode#end#elseif($studentLevel=='TP')Masters Student#elseif($studentLevel=='RP')P/G#elseif($studentLevel=='UG' && $levelCode.contains(\"A\"))U/G Abroad#elseif($studentLevel == 'UG' && $levelCode == '99'))U/G Year Unknown#elseif(($studentLevel == 'UG' && ($levelCode.startsWith('01') || $levelCode.startsWith('02') || $levelCode.startsWith('03') || $levelCode.startsWith('04') || $levelCode.startsWith('05') || $levelCode.startsWith('06') || $levelCode.startsWith('07') || $levelCode.startsWith('08') || $levelCode.startsWith('09')) && $levelCode != '99'))U/G Year #if($levelCode.contains('0'))$levelCode.replace('0','')#{else}$levelCode#end#elseif($studentLevel == 'UG' && $levelCode == 'blank' && $status == 'RE')U/G Unregistered#else U/G Unknown#end#elseif($lifecycle == 'inactive')Disabled Students User#elseif($lifecycle == 'lapsed')lapsed Students User#end"
},
"internal": false

```

}

---

<div class="post-metadata">

**Author:** ![atarodia](https://avatars.discourse-cdn.com/v4/letter/a/f17d59/32.png) [@atarodia](https://developer.sailpoint.com/discuss/u/atarodia)\
**Post date:** [December 1, 2023, 1:06pm UTC](https://developer.sailpoint.com/discuss/t/issue-in-transform/21831/2 "2023-12-01T13:06:58Z")

</div>

Hi @Harish_accenture,

Try adding an `#{else}Unknown` condition before you end the logic.

---

<div class="post-metadata">

**Author:** ![Harish\_accenture](https://avatars.discourse-cdn.com/v4/letter/h/ce73a5/32.png) [@Harish\_accenture](https://developer.sailpoint.com/discuss/u/Harish_accenture)\
**Post date:** [December 4, 2023, 8:45am UTC](https://developer.sailpoint.com/discuss/t/issue-in-transform/21831/3 "2023-12-04T08:45:34Z")

</div>

It is not working only when evaluation following condition #elseif($lifecycle == ‘inactive’)Disabled Students User#elseif($lifecycle == ‘lapsed’)lapsed Students User#end. It is working without this.

---

<div class="post-metadata">

**Author:** ![Harish\_accenture](https://avatars.discourse-cdn.com/v4/letter/h/ce73a5/32.png) [@Harish\_accenture](https://developer.sailpoint.com/discuss/u/Harish_accenture)\
**Post date:** [December 4, 2023, 8:49am UTC](https://developer.sailpoint.com/discuss/t/issue-in-transform/21831/4 "2023-12-04T08:49:42Z")

</div>

@atarodia - Yes, I tried but it didn’t work.

---

<div class="post-metadata">

**Author:** ![atarodia](https://avatars.discourse-cdn.com/v4/letter/a/f17d59/32.png) [@atarodia](https://developer.sailpoint.com/discuss/u/atarodia)\
**Post date:** [December 6, 2023, 3:48pm UTC](https://developer.sailpoint.com/discuss/t/issue-in-transform/21831/5 "2023-12-06T15:48:30Z")

</div>

In the condition just before `#elseif($lifecycle == ‘inactive’)Disabled`, you are using `#else U/G Unknown#end`

Try changing that `#else` to ` #{else}`

---

<div class="post-metadata">

**Author:** ![sup3rmark](https://sea1.discourse-cdn.com/sailpoint/discuss/user_avatar/developer.sailpoint.com/sup3rmark/32/36229_2.png) [@sup3rmark](https://developer.sailpoint.com/discuss/u/sup3rmark)\
**Post date:** [December 6, 2023, 5:01pm UTC](https://developer.sailpoint.com/discuss/t/issue-in-transform/21831/6 "2023-12-06T17:01:58Z")

</div>

I think there’s bigger issues with this transform.

You have the following :

- if
  - if
  - else
  - end

- elseif
- elseif
- elseif
- elseif
- elseif
- elseif
  - if
  - else
  - end

- elseif
- else
- end
- _elseif_
- _elseif_
- _end_

assuming those `if/else/end`s should be nested where they are, those are fine, but you have two `elseif`s and an `end` at the end that don’t match up to anything.

---

<div class="post-metadata">

**Author:** ![Harish\_accenture](https://avatars.discourse-cdn.com/v4/letter/h/ce73a5/32.png) [@Harish\_accenture](https://developer.sailpoint.com/discuss/u/Harish_accenture)\
**Post date:** [December 8, 2023, 5:25am UTC](https://developer.sailpoint.com/discuss/t/issue-in-transform/21831/7 "2023-12-08T05:25:37Z")

</div>

It worked. Thank you!

---

<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:** [February 6, 2024, 5:25am UTC](https://developer.sailpoint.com/discuss/t/issue-in-transform/21831/8 "2024-02-06T05:25:48Z")

</div>

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