Parse exception in LCS transform

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

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

Hi @ankita1,
Can you try this below 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"
}

-Vasanth

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

1 Like

Hi Theja,

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

{
“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”
}
}

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, in UTC time zone"

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

1 Like

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

{
    "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"
    },
}

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.

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:

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

Hi @ankita1,

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

{
    "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

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