Lifecycle Transform with Employee type Render Error

Hello,

I am working on a transform that will when the account is a New Contingent and the start date is on or over the lifecycle is active. For some reason I am getting a render error and just need a second eye on this.

{
    "id": "XXXXXX",
    "name": "Non-EMployee LifeCycle Transform",
    "type": "static",
    "attributes": {
        "requiresPeriodicRefresh": "true",
        "New Contingent": {
            "attributes": {
                "values": [
                    {
                        "attributes": {
                            "attributeName": "Emp_Type",
                            "sourceName": "XXXX Testing Source"
                        },
                        "type": "accountAttribute"
                    },
                    "New Contingent"
                ]
            },
            "type": "firstValid"
        },
        "activestate": {
            "attributes": {
                "firstDate": "now",
                "secondDate": {
                    "attributes": {
                        "input": {
                            "type": "accountAttribute",
                            "attributes": {
                                "attributeName": "startDate",
                                "sourceName": "XXXX Testing Source"
                            }
                        },
                        "inputFormat": "MM/dd/yyyy",
                        "outputFormat": "ISO8601"
                    },
                    "type": "dateFormat"
                },
                "operator": "GTE",
                "positiveCondition": "yes",
                "negativeCondition": "no"
            },
            "type": "dateCompare"
        },
        "inactivestate": {
            "attributes": {
                "firstDate": "now",
                "secondDate": {
                    "type": "firstValid",
                    "attributes": {
                        "values": [
                            {
                                "attributes": {
                                    "input": {
                                        "type": "accountAttribute",
                                        "attributes": {
                                            "attributeName": "startdate",
                                            "sourceName": "XXXX  Testing Source"
                                        }
                                    },
                                    "inputFormat": "MM/dd/yyyy",
                                    "outputFormat": "ISO8601"
                                },
                                "type": "dateFormat"
                            },
                            "now"
                        ],
                        "ignoreErrors": "true"
                    }
                },
                "operator": "GT",
                "positiveCondition": "yes",
                "negativeCondition": "no"
            },
            "type": "dateCompare"
        },
        "value": "#if($inactivestate=='yes')inactive#elseif(($activestate=='yes') && ($inactivestate=='no') && ($New Contingent.equals(\"New Contingent\")active#{else}UNKNOWN#end"
    },
    "internal": false
}
 

You have an extra parenthesis. The correct should be
“value”: “#if($inactivestate==‘yes’)inactive#elseif($activestate==‘yes’) && ($inactivestate==‘no’) && ($New Contingent.equals("New Contingent")active#{else}UNKNOWN#end”

1 Like

I am getting a syntix error with your code realted to the New Contingent line. If i remove it it works. I changed it to this below however and now getting this

image

“value”: “#if($inactivestate==‘yes’)inactive#elseif($activestate==‘yes’) && ($inactivestate==‘no’) && ($NewContingent.equals(‘New Contingent’)active#{else}UNKNOWN#end”

I also removed the space for NewContingent

"id": "",
    "name":  LifeCycle Transform",
    "type": "static",
    "attributes": {
        "requiresPeriodicRefresh": "true",
        "NewContingent": {
            "attributes": {
                "values": [
                    {
                        "attributes": {
                            "attributeName": "field157153",   <--- emp type on feed
                            "sourceName": XXXX Testing Source"
                        },
                        "type": "accountAttribute"
                    },
                    "New Contingent"
                ]
            },
            "type": "firstValid"
        },
        "activestate": {
            "attributes": {
                "firstDate": "now",
                "secondDate": {
                    "attributes": {
                        "input": {
                            "type": "accountAttribute",
                            "attributes": {
                                "attributeName": "startDate",
                                "sourceName": "XXXX Testing Source"
                            }
                        },
                        "inputFormat": "MM/dd/yyyy",
                        "outputFormat": "ISO8601"
                    },
                    "type": "dateFormat"
                },
                "operator": "GTE",
                "positiveCondition": "yes",
                "negativeCondition": "no"
            },
            "type": "dateCompare"
        },
        "inactivestate": {
            "attributes": {
                "firstDate": "now",
                "secondDate": {
                    "type": "firstValid",
                    "attributes": {
                        "values": [
                            {
                                "attributes": {
                                    "input": {
                                        "type": "accountAttribute",
                                        "attributes": {
                                            "attributeName": "field15070",   <----end date on feed
                                            "sourceName": "XXXX Testing Source"
                                        }
                                    },
                                    "inputFormat": "MM/dd/yyyy",
                                    "outputFormat": "ISO8601"
                                },
                                "type": "dateFormat"
                            },
                            "now"
                        ],
                        "ignoreErrors": "true"
                    }
                },
                "operator": "GT",
                "positiveCondition": "yes",
                "negativeCondition": "no"
            },
            "type": "dateCompare"
        },
        "value": "#if($inactivestate=='yes')inactive#elseif($activestate=='yes') && ($inactivestate=='no') && ($NewContingent.equals('New Contingent')active#{else}UNKNOWN#end"
    },
    "internal": false
}

@ChicagoDev2025 try to use the below

“#if(($inactivestate.equals(‘yes’)))inactive#{elseif}(($activestate.equals(‘yes’)) && $inactivestate.equals(‘no’) && $New Contingent.equals(‘New Contingent’))active#{else}UNKNOWN#end”