# Parse exception in LCS transform

**URL:** <https://developer.sailpoint.com/discuss/t/parse-exception-in-lcs-transform/95992>\
**Category:** SHF Discussion and Questions\
**Tags:** transforms, sailpoint-identity-security\
**Created:** [January 6, 2025, 12:35pm UTC](https://developer.sailpoint.com/discuss/t/parse-exception-in-lcs-transform/95992 "2025-01-06T12:35:20Z")\
**Posts on this page:** 11\
**Page:** 1

<div class="post-metadata">

**Author:** ![ankita1](https://avatars.discourse-cdn.com/v4/letter/a/d07c76/32.png) [@ankita1](https://developer.sailpoint.com/discuss/u/ankita1)\
**Post date:** [January 6, 2025, 12:35pm UTC](https://developer.sailpoint.com/discuss/t/parse-exception-in-lcs-transform/95992/1 "2025-01-06T12:35:20Z")

</div>

Hi Team,

I am getting parse exception in preview of Identity Profile as below for the transform in LifecycleState attribute.

Error : There was an exception while calculating the value for this attribute. Error during transformation for attribute: cloudLifecycleState (Transform ID: IAME-Lifecycle State Transfrom) Cause: Text ‘’ could not be parsed at index 0

Transform:

{  
“name”: “IAME-Lifecycle State Transfrom”,  
“type”: “static”,  
“attributes”: {  
“Within7Days”: {  
“type”: “dateCompare”,  
“attributes”: {  
“firstDate”: {  
“type”: “dateFormat”,  
“attributes”: {  
“input”: {  
“type”: “accountAttribute”,  
“attributes”: {  
“sourceName”: “Lab Auth Source”,  
“attributeName”: “startDate”  
}  
},  
“inputFormat”: “dd/MM/yyyy”,  
“outputFormat”: “ISO8601”  
}  
},  
“secondDate”: {  
“type”: “dateFormat”,  
“attributes”: {  
“input”: {  
“type”: “dateMath”,  
“attributes”: {  
“expression”: “now+7d”  
}  
},  
“inputFormat”: “dd/MM/yyyy”,  
“outputFormat”: “ISO8601”  
}  
},  
“operator”: “lte”,  
“positiveCondition”: “true”,  
“negativeCondition”: “false”  
}  
},  
“MoreThan7Days”: {  
“type”: “dateCompare”,  
“attributes”: {  
“firstDate”: {  
“type”: “dateFormat”,  
“attributes”: {  
“input”: {  
“type”: “accountAttribute”,  
“attributes”: {  
“sourceName”: “Lab Auth Source”,  
“attributeName”: “startDate”  
}  
},  
“inputFormat”: “dd/MM/yyyy”,  
“outputFormat”: “ISO8601”  
}  
},  
“secondDate”: {  
“type”: “dateFormat”,  
“attributes”: {  
“input”: {  
“type”: “dateMath”,  
“attributes”: {  
“expression”: “now+7d”  
}  
},  
“inputFormat”: “dd/MM/yyyy”,  
“outputFormat”: “ISO8601”  
}  
},  
“operator”: “gte”,  
“positiveCondition”: “true”,  
“negativeCondition”: “false”  
}  
},  
“inPresent”: {  
“type”: “dateCompare”,  
“attributes”: {  
“firstDate”: {  
“type”: “dateFormat”,  
“attributes”: {  
“input”: {  
“type”: “accountAttribute”,  
“attributes”: {  
“sourceName”: “Lab Auth Source”,  
“attributeName”: “startDate”  
}  
},  
“inputFormat”: “dd/MM/yyyy”,  
“outputFormat”: “ISO8601”  
}  
},  
“secondDate”: {  
“type”: “dateFormat”,  
“attributes”: {  
“input”: {  
“type”: “dateMath”,  
“attributes”: {  
“expression”: “now”  
}  
},  
“inputFormat”: “dd/MM/yyyy”,  
“outputFormat”: “ISO8601”  
}  
},  
“operator”: “gte”,  
“positiveCondition”: “true”,  
“negativeCondition”: “false”  
}  
},  
“value”: “#if($Within7Days == ‘true’)hireinactive#elseif($MoreThan7Days == ‘true’)prehire#elseif($inPresent == ‘true’)active#{else}inactive#end”  
}  
}

Could you please help me finding what i causing the issue here?

Thank You

---

<div class="post-metadata">

**Author:** ![JackSparrow](https://sea1.discourse-cdn.com/sailpoint/discuss/user_avatar/developer.sailpoint.com/jacksparrow/32/19685_2.png) [@JackSparrow](https://developer.sailpoint.com/discuss/u/JackSparrow)\
**Post date:** [January 6, 2025, 1:17pm UTC](https://developer.sailpoint.com/discuss/t/parse-exception-in-lcs-transform/95992/2 "2025-01-06T13:17:40Z")

</div>

Could you please confirm the identities you are previewing has start date value coming from the feed and is in correct format i.e., dd/mm/yyyy?

Also, please paste the transform in the formatted text for easy reading. You can use below highlighted option for the same

![image](https://global.discourse-cdn.com/sailpoint/original/3X/1/0/108ba1c2e77fbe2dde5f8678576a00e608feecee.png)

---

<div class="post-metadata">

**Author:** ![vasanthrajsp29](https://sea1.discourse-cdn.com/sailpoint/discuss/user_avatar/developer.sailpoint.com/vasanthrajsp29/32/20713_2.png) [@vasanthrajsp29](https://developer.sailpoint.com/discuss/u/vasanthrajsp29)\
**Post date:** [January 6, 2025, 1:23pm UTC](https://developer.sailpoint.com/discuss/t/parse-exception-in-lcs-transform/95992/3 "2025-01-06T13:23:29Z")

</div>

Hi @ankita1,  
Can you try this below transform?

```auto
{
    "name": "IAME-Lifecycle State Transfrom",
    "type": "static",
    "attributes": {
        "Within7Days": {
            "type": "dateCompare",
            "attributes": {
                "firstDate": {
                    "type": "dateFormat",
                    "attributes": {
                        "input": {
                            "type": "accountAttribute",
                            "attributes": {
                                "sourceName": "Lab Auth Source",
                                "attributeName": "startDate"
                            }
                        },
                        "inputFormat": "dd/MM/yyyy",
                        "outputFormat": "ISO8601"
                    }
                },
                "secondDate": {
                    "type": "dateFormat",
                    "attributes": {
                        "input": {
                            "type": "dateMath",
                            "attributes": {
                                "expression": "now+7d"
                            }
                        },
                        "inputFormat": "dd/MM/yyyy",
                        "outputFormat": "ISO8601"
                    }
                },
                "operator": "lte",
                "positiveCondition": "true",
                "negativeCondition": "false"
            }
        },
        "MoreThan7Days": {
            "type": "dateCompare",
            "attributes": {
                "firstDate": {
                    "type": "dateFormat",
                    "attributes": {
                        "input": {
                            "type": "accountAttribute",
                            "attributes": {
                                "sourceName": "Lab Auth Source",
                                "attributeName": "startDate"
                            }
                        },
                        "inputFormat": "dd/MM/yyyy",
                        "outputFormat": "ISO8601"
                    }
                },
                "secondDate": {
                    "type": "dateFormat",
                    "attributes": {
                        "input": {
                            "type": "dateMath",
                            "attributes": {
                                "expression": "now+7d"
                            }
                        },
                        "inputFormat": "dd/MM/yyyy",
                        "outputFormat": "ISO8601"
                    }
                },
                "operator": "gte",
                "positiveCondition": "true",
                "negativeCondition": "false"
            }
        },
        "inPresent": {
            "type": "dateCompare",
            "attributes": {
                "firstDate": {
                    "type": "dateFormat",
                    "attributes": {
                        "input": {
                            "type": "accountAttribute",
                            "attributes": {
                                "sourceName": "Lab Auth Source",
                                "attributeName": "startDate"
                            }
                        },
                        "inputFormat": "dd/MM/yyyy",
                        "outputFormat": "ISO8601"
                    }
                },
                "secondDate": {
                    "type": "dateFormat",
                    "attributes": {
                        "input": {
                            "type": "dateMath",
                            "attributes": {
                                "expression": "now"
                            }
                        },
                        "inputFormat": "dd/MM/yyyy",
                        "outputFormat": "ISO8601"
                    }
                },
                "operator": "gte",
                "positiveCondition": "true",
                "negativeCondition": "false"
            }
        },
        "value": "#if($Within7Days=='true')hireinactive#elseif($MoreThan7Days=='true')prehire#elseif($inPresent=='true')active#{else}inactive#end"
}

```

-Vasanth

---

<div class="post-metadata">

**Author:** ![gourab](https://sea1.discourse-cdn.com/sailpoint/discuss/user_avatar/developer.sailpoint.com/gourab/32/18650_2.png) [@gourab](https://developer.sailpoint.com/discuss/u/gourab)\
**Post date:** [January 6, 2025, 1:47pm UTC](https://developer.sailpoint.com/discuss/t/parse-exception-in-lcs-transform/95992/4 "2025-01-06T13:47:27Z")

</div>

Hi @ankita1  
I suggest you to apply the **firstValid** transform to the start date & this will address any empty values

---

<div class="post-metadata">

**Author:** ![ankita1](https://avatars.discourse-cdn.com/v4/letter/a/d07c76/32.png) [@ankita1](https://developer.sailpoint.com/discuss/u/ankita1)\
**Post date:** [January 6, 2025, 2:11pm UTC](https://developer.sailpoint.com/discuss/t/parse-exception-in-lcs-transform/95992/5 "2025-01-06T14:11:57Z")

</div>

Hi Theja,

Yes, I can confirm all the identities have startDate value present and it is in format dd/MM/yyyy (21/12/2025)

```auto
{
“name”: “IAME-Lifecycle State Transfrom”,
“type”: “static”,
“attributes”: {
“Within7Days”: {
“type”: “dateCompare”,
“attributes”: {
“firstDate”: {
“type”: “dateFormat”,
“attributes”: {
“input”: {
“type”: “accountAttribute”,
“attributes”: {
“sourceName”: “Lab Auth Source”,
“attributeName”: “startDate”
}
},
“inputFormat”: “dd/MM/yyyy”,
“outputFormat”: “ISO8601”
}
},
“secondDate”: {
“type”: “dateFormat”,
“attributes”: {
“input”: {
“type”: “dateMath”,
“attributes”: {
“expression”: “now+7d”
}
},
“inputFormat”: “dd/MM/yyyy”,
“outputFormat”: “ISO8601”
}
},
“operator”: “lte”,
“positiveCondition”: “true”,
“negativeCondition”: “false”
}
},
“MoreThan7Days”: {
“type”: “dateCompare”,
“attributes”: {
“firstDate”: {
“type”: “dateFormat”,
“attributes”: {
“input”: {
“type”: “accountAttribute”,
“attributes”: {
“sourceName”: “Lab Auth Source”,
“attributeName”: “startDate”
}
},
“inputFormat”: “dd/MM/yyyy”,
“outputFormat”: “ISO8601”
}
},
“secondDate”: {
“type”: “dateFormat”,
“attributes”: {
“input”: {
“type”: “dateMath”,
“attributes”: {
“expression”: “now+7d”
}
},
“inputFormat”: “dd/MM/yyyy”,
“outputFormat”: “ISO8601”
}
},
“operator”: “gte”,
“positiveCondition”: “true”,
“negativeCondition”: “false”
}
},
“inPresent”: {
“type”: “dateCompare”,
“attributes”: {
“firstDate”: {
“type”: “dateFormat”,
“attributes”: {
“input”: {
“type”: “accountAttribute”,
“attributes”: {
“sourceName”: “Lab Auth Source”,
“attributeName”: “startDate”
}
},
“inputFormat”: “dd/MM/yyyy”,
“outputFormat”: “ISO8601”
}
},
“secondDate”: {
“type”: “dateFormat”,
“attributes”: {
“input”: {
“type”: “dateMath”,
“attributes”: {
“expression”: “now”
}
},
“inputFormat”: “dd/MM/yyyy”,
“outputFormat”: “ISO8601”
}
},
“operator”: “gte”,
“positiveCondition”: “true”,
“negativeCondition”: “false”
}
},
“value”: “#if($Within7Days == ‘true’)hireinactive#elseif($MoreThan7Days == ‘true’)prehire#elseif($inPresent == ‘true’)active#{else}inactive#end”
}
}

```

---

<div class="post-metadata">

**Author:** ![PhilRawlings1](https://sea1.discourse-cdn.com/sailpoint/discuss/user_avatar/developer.sailpoint.com/philrawlings1/32/37266_2.png) [@PhilRawlings1](https://developer.sailpoint.com/discuss/u/PhilRawlings1)\
**Post date:** [January 6, 2025, 3:44pm UTC](https://developer.sailpoint.com/discuss/t/parse-exception-in-lcs-transform/95992/6 "2025-01-06T15:44:23Z")

</div>

Hi,  
“The output format for the DateMath transform is “yyyy-MM-dd’T’HH:mm”.” &  
" The input datetime value must always be in [ISO8601 format](https://en.wikipedia.org/wiki/ISO_8601), in UTC time zone"

> **[Date Math | SailPoint Developer Community](https://developer.sailpoint.com/docs/extensibility/transforms/operations/date-math/)**
>
> Add, subtract, and round components of a timestamp's incoming value.

So you are going to need to format the date before the dateMath function, and again for the dateCompare function

---

<div class="post-metadata">

**Author:** ![ankita1](https://avatars.discourse-cdn.com/v4/letter/a/d07c76/32.png) [@ankita1](https://developer.sailpoint.com/discuss/u/ankita1)\
**Post date:** [January 6, 2025, 4:38pm UTC](https://developer.sailpoint.com/discuss/t/parse-exception-in-lcs-transform/95992/7 "2025-01-06T16:38:04Z")

</div>

Thank You Phil for the help but i am still getting the same error. I have updated transform as below.

```auto
{
    "name": "IAME LCS Transfrom",
    "type": "static",
    "attributes": {
        "isActive": {
            "type": "dateCompare",
            "attributes": {
                "firstDate": {
                    "type": "dateFormat",
                    "attributes": {
                        "input": {
                            "type": "dateMath",
                            "attributes": {
                                "expression": "now"
                            }
                        },
                        "inputFormat": "yyyy-MM-dd'T'HH:mm",
                        "outputFormat": "ISO8601"
                    }
                },
                "secondDate": {
                    "type": "dateFormat",
                    "attributes": {
                        "input": {
                            "type": "accountAttribute",
                            "attributes": {
                                "sourceName": "IAMExperts Lab Auth Source",
                                "attributeName": "startDate"
                            }
                        },
                        "inputFormat": "dd/MM/yyyy",
                        "outputFormat": "ISO8601"
                    }
                },
                "operator": "GTE",
                "positiveCondition": "true",
                "negativeCondition": "false"
            }
        },
        "Within7Days": {
            "type": "dateCompare",
            "attributes": {
                "firstDate": {
                    "type": "dateFormat",
                    "attributes": {
                        "input": {
                            "type": "accountAttribute",
                            "attributes": {
                                "sourceName": "IAMExperts Lab Auth Source",
                                "attributeName": "startDate"
                            }
                        },
                        "inputFormat": "dd/MM/yyyy",
                        "outputFormat": "ISO8601"
                    }
                },
                "secondDate": {
                    "type": "dateFormat",
                    "attributes": {
                        "input": {
                            "type": "dateMath",
                            "attributes": {
                                "expression": "now+7d"
                            }
                        },
                        "inputFormat": "yyyy-MM-dd'T'HH:mm",
                        "outputFormat": "ISO8601"
                    }
                },
                "operator": "lte",
                "positiveCondition": "true",
                "negativeCondition": "false"
            }
        },
        "value": "#if($isActive=='false'&&$Within7Days=='true')hireinactive#elseif($isActive=='true')active#{else}prehire#end"
    },
}

```

---

<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:** [January 6, 2025, 4:51pm UTC](https://developer.sailpoint.com/discuss/t/parse-exception-in-lcs-transform/95992/8 "2025-01-06T16:51:01Z")

</div>

When troubleshooting a complex transform like a LCS transform, I always recommend splitting each of the variables out to a separate transform (in dev/sandbox specifically) to more easily pinpoint which of the cases is throwing the error.

In this case, I’d create separate transforms for `isActive` and `within7Days`, and map those to their own Identity Attributes and see where your error is. If neither of those Identity Attributes throws an error, that’ll likely point to an issue with the Velocity code at the end of your LCS transform.

---

<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:** [January 6, 2025, 5:01pm UTC](https://developer.sailpoint.com/discuss/t/parse-exception-in-lcs-transform/95992/9 "2025-01-06T17:01:40Z")

</div>

> [@ankita1](#):
>
> ```json
> "secondDate": {
> "type": "dateFormat",
> "attributes": {
> "input": {
> "type": "dateMath",
> "attributes": {
> "expression": "now+7d"
> }
> },
> "inputFormat": "yyyy-MM-dd'T'HH:mm",
> "outputFormat": "ISO8601"
> }
> },
> 
> ```

You shouldn’t need to do a dateFormat for this. `now` is already in ISO8601 format. Not sure this would cause the error, but I’d switch it to just this:

```json
"secondDate": {
    "type": "dateMath",
    "attributes": {
        "expression": "now+7d"
    }
},

```

---

<div class="post-metadata">

**Author:** ![vasanthrajsp29](https://sea1.discourse-cdn.com/sailpoint/discuss/user_avatar/developer.sailpoint.com/vasanthrajsp29/32/20713_2.png) [@vasanthrajsp29](https://developer.sailpoint.com/discuss/u/vasanthrajsp29)\
**Post date:** [January 6, 2025, 5:09pm UTC](https://developer.sailpoint.com/discuss/t/parse-exception-in-lcs-transform/95992/10 "2025-01-06T17:09:33Z")

</div>

Hi @ankita1,

This transform is working without error, Can you try this transform?

```auto
{
    "name": "IAME LCS Transfrom",
    "type": "static",
    "attributes": {
        "isActive": {
            "type": "dateCompare",
            "attributes": {
                "firstDate": {
                    "type": "dateFormat",
                    "attributes": {
                        "input": {
                            "type": "dateMath",
                            "attributes": {
                                "expression": "now"
                            }
                        },
                        "inputFormat": "yyyy-MM-dd'T'HH:mm",
                        "outputFormat": "ISO8601"
                    }
                },
                "secondDate": {
                    "type": "firstValid",
                    "attributes": {
                        "values": [
                            {
                                "type": "dateFormat",
                                "attributes": {
                                    "input": {
                                        "type": "accountAttribute",
                                        "attributes": {
                                            "sourceName": "Lab Auth Source",
                                            "attributeName": "startDate"
                                        }
                                    },
                                    "inputFormat": "dd-MM-yyyy",
                                    "outputFormat": "ISO8601"
                                }
                            },
                            {
                                "type": "dateFormat",
                                "attributes": {
                                    "input": {
                                        "type": "static",
                                        "attributes": {
                                            "value": "01-01-1950"
                                        }
                                    },
                                    "inputFormat": "dd-MM-yyyy",
                                    "outputFormat": "ISO8601"
                                }
                            }
                        ]
                    }
                },
                "operator": "GTE",
                "positiveCondition": "true",
                "negativeCondition": "false"
            }
        },
        "Within7Days": {
            "type": "dateCompare",
            "attributes": {
                "firstDate": {
                    "type": "firstValid",
                    "attributes": {
                        "values": [
                            {
                                "type": "dateFormat",
                                "attributes": {
                                    "input": {
                                        "type": "accountAttribute",
                                        "attributes": {
                                            "sourceName": "Lab Auth Source",
                                            "attributeName": "startDate"
                                        }
                                    },
                                    "inputFormat": "dd-MM-yyyy",
                                    "outputFormat": "ISO8601"
                                }
                            },
                            {
                                "type": "dateFormat",
                                "attributes": {
                                    "input": {
                                        "type": "static",
                                        "attributes": {
                                            "value": "01-01-1950"
                                        }
                                    },
                                    "inputFormat": "dd-MM-yyyy",
                                    "outputFormat": "ISO8601"
                                }
                            }
                        ]
                    }
                },
                "secondDate": {
                    "type": "dateFormat",
                    "attributes": {
                        "input": {
                            "type": "dateMath",
                            "attributes": {
                                "expression": "now+7d"
                            }
                        },
                        "inputFormat": "yyyy-MM-dd'T'HH:mm",
                        "outputFormat": "ISO8601"
                    }
                },
                "operator": "lte",
                "positiveCondition": "true",
                "negativeCondition": "false"
            }
        },
        "value": "#if($isActive=='false'&&$Within7Days=='true')hireinactive#elseif($isActive=='true')active#{else}prehire#end"
    }
}

```

-Vasanth

---

<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:** [March 7, 2025, 5:10pm UTC](https://developer.sailpoint.com/discuss/t/parse-exception-in-lcs-transform/95992/11 "2025-03-07T17:10:15Z")

</div>

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