Type Static Transform and the Condition Value

The attached transform refers to 3 different transforms and based on the value we get as output from them, we have written the “value” condition to calculate the status of the user.

The 3 attributes are,

  1. wdstatus - refers to a different transform that returns the output to be either “Active” or “Inactive”
  2. lhstatus - refers to a different transform that returns the output to be either “inactivelegalhold” or “NONE”
  3. conversionstatus - refers to a different transform that returns the output to be either “true” or “false”

Individually the transforms are working fine. Getting the desired output. But when we use the values returned from these transforms into the “Value” condition below, we aren’t returning the default value of the condition. Kindly let me know what is going wrong with this condition.

What we want to achieve:
wdstatus: active and conversionstatus:inactive then status of the user: active
wdstatus: inactive and conversionstatus:active then status of the user: active
wdstatus: active and conversionstatus:active then status of the user: active
wdstatus: inactive and conversionstatus:inactive then status of the user: inactive
lhstatus is not equal to “NONE”, then status of the user: inactivelegalhold

Tried the below conditions and none seem to work. Kindly let me know where I’m going wrong,

  1. “value”: “#if(($wdstatus == ‘active’ && $conversionstatus==‘false’) || ($wdstatus == ‘active’ && $conversionstatus==‘true’) || ($wdstatus == ‘inactive’ && $conversionstatus==‘true’))active#{elseif}($lhstatus != ‘NONE’)inactivelegalhold#{else}inactive#end”

  2. “value”: “#if($wdstatus == ‘inactive’ && $conversionstatus==‘true’)active#{elseif}($wdstatus == ‘inactive’ && $conversionstatus==‘false’)inactive#{elseif}($lhstatus != ‘NONE’)inactivelegalhold#{else}active#end”

  3. “value”: “#if($wdstatus == ‘inactive’ && $conversionstatus==‘true’)active#{elseif}($wdstatus == ‘active’ && $conversionstatus==‘false’)active#{elseif}($wdstatus == ‘active’ && $conversionstatus==‘true’)active#{elseif}($lhstatus != ‘NONE’)inactivelegalhold#{else}inactive#end”

{
    "name": "Life Cycle State - Conversion Sowmi Test",
    "type": "static",
    "attributes": {
        "wdstatus": {
            "attributes": {
                "id": "Workday Lifecycle State based on Date"
            },
            "type": "reference"
        },
        "lhstatus": {
            "attributes": {
                "values": [
                    {
                        "attributes": {
                            "id": "LegalHoldValue"
                        },
                        "type": "reference"
                    },
                    "NONE"
                ]
            },
            "type": "firstValid"
        },
        "conversionstatus": {
            "attributes": {
                "id": "User Conversion - Sowmi Test"
            },
            "type": "reference"
        },
        "value": "#if($wdstatus == 'active' && $conversionstatus=='true')active#{elseif}($wdstatus == 'active' && $conversionstatus=='false')active##{elseif}($wdstatus == 'inactive' && $conversionstatus=='false')inactive#{elseif}($wdstatus == 'inactive' && $conversionstatus=='true')active#{elseif}($lhstatus != 'NONE')inactivelegalhold#{else}inactive#end"
    },
}

Hello @v_sowmithri,

First off welcome to the developer community!

I have a couple things I am seeing here that could cause issues, spaces in your final value string and the capitalization of active/inactive from wdstatus.

This value string has the spaces removed that you can try first.

“value”: “#if(($wdstatus==‘active’&&$conversionstatus==‘false’)||($wdstatus==‘active’&&$conversionstatus==‘true’)||($wdstatus==‘inactive’&&$conversionstatus==‘true’))active#{elseif}($lhstatus!=‘NONE’)inactivelegalhold#{else}inactive#end”

Would you be able to provide the other transforms you are referencing here?

Thank you for your response @tyler_mairose . Lemme try to incorporate you solution and let you know how that works.

Meanwhile here are the other transforms that are referred in this transform

WDSTATUS

{
        "id": "6cd11686-ca15-4d9b-ac4a-bb8228048899",
        "name": "Workday Lifecycle State based on Date",
        "type": "dateCompare",
        "attributes": {
            "firstDate": {
                "attributes": {
                    "input": {
                        "attributes": {
                            "expression": "now/d"
                        },
                        "type": "dateMath"
                    },
                    "inputFormat": "yyyy-MM-dd'T'HH:mm",
                    "outputFormat": "ISO8601"
                },
                "type": "dateFormat"
            },
            "negativeCondition": "inactive",
            "operator": "lte",
            "positiveCondition": "active",
            "secondDate": {
                "attributes": {
                    "input": {
                        "attributes": {
                            "values": [
                                {
                                    "attributes": {
                                        "attributeName": "LAST_DAY_OF_WORK",
                                        "sourceName": "Workday"
                                    },
                                    "type": "accountAttribute"
                                },
                                "12/31/2999"
                            ]
                        },
                        "type": "firstValid"
                    },
                    "inputFormat": "MM/dd/yyyy",
                    "outputFormat": "ISO8601"
                },
                "type": "dateFormat"
            }
        },
        "internal": false
    }

LHSTATUS

{
        "id": "afb4225a-84e0-45ca-82d0-c43e8f17045e",
        "name": "LegalHoldValue",
        "type": "replace",
        "attributes": {
            "regex": ".",
            "replacement": "inactivelegalhold",
            "input": {
                "type": "accountAttribute",
                "attributes": {
                    "sourceName": "LegalHold",
                    "attributeName": "Active"
                }
            }
        },
        "internal": false
    }

CONVERSIONSTATUS

{
        "id": "3ed5ef97-2456-41d7-b329-f052e8bc7a0e",
        "name": "User Conversion - Sowmi Test",
        "type": "conditional",
        "attributes": {
            "expression": "$conversionUser eq TERMINATION_SUBCATEGORY-3-51",
            "positiveCondition": "true",
            "negativeCondition": "false",
            "conversionUser": {
                "attributes": {
                    "values": [
                        {
                            "attributes": {
                                "sourceName": "Workday",
                                "attributeName": "END_EMPLOYMENT_REASON_REFERENCE"
                            },
                            "type": "accountAttribute"
                        },
                        {
                            "attributes": {
                                "value": "none"
                            },
                            "type": "static"
                        }
                    ]
                },
                "type": "firstValid"
            }
        },
        "internal": false
    }