Reference Lookup Table transform from inside the LCS Transform

Hello Experts,
I am working on a Lifecycle State transform and I am using the same set of time periods (Ex: Start Date - 20 Days, End Date +10 Days) at multiple locations to calculate the LCS of the identity.
When there is any update in the requirement regarding the time periods like the prejoin state should be given from Start Date - 5 days instead of Start Date - 10 days, I have to make changes at multiple places. To reduce the effort, I wanted to use a lookup transform where I will store all the required values and every time I need to use the values, I will reference this lookup transform and get the desired value. If there is an update in the requirement again, then I just need to make the changes at a single location, this will help in minimizing the effort and also makes it easier to understand. I need some help to structure this perfectly.
My current thought process is to Create a seperate lookup transform and reference that lookup transform where ever I need the Time Period values.
Example:

{
    "type":"dateMath",
    "attributes":{
        "expression":{
            "type":"reference",
            "attributes":{
                "id":"Lookup_Transform"
            }
        },
        "input":{
            "type":"accountAttribute",
            "attributes":{
                "attributeName":"EndDate",
                "sourceName":"Auth_Source"
            }
        }
    }
}

But I am not sure how to pass the input to the Lookup Transform to get back the desired value. Kindly let me know if you have worked on this.

Please share you thoughts if you think this can be acheived with a better approach.

Appreciate your help… Thankyou.

Hi,

It appears input is an optional attribute for reference transforms. You would have to test this, but possibly something like this…

{
    "type":"dateMath",
    "attributes":{
        "expression":{
            "type":"reference",
            "attributes":{
                "input": "<your input here>",
                "id":"Lookup_Transform"
            }
        },
        "input":{
            "type":"accountAttribute",
            "attributes":{
                "attributeName":"EndDate",
                "sourceName":"Auth_Source"
            }
        }
    }
}

Hope it’s helpful.

Thanks,
Jade

2 Likes

Thankyou for your responce Jade,

If we use the input attribute in the reference transform, it should pass that input value to the transform we are referencing. And we need not to use input inside the Lookup Transform. Is my understanding correct?

I believe so, by adding an input to the reference this should pass the input into the lookup transform. Let me know how testing goes :smile:

1 Like

Hello @jade-townsend ,
I have created a seperate transform with lookup table and tried to reference it by passing input through the reference transform. It worked and I am able to get the desired values. Now I can just reference the same transform at multiple places and if there are any updates to the time periods I can handle it just by updating at one place.

Lookup Transform Example:

{
    "id": "Transform ID",
    "name": "Look Up Values",
    "type": "lookup",
    "attributes": {
        "table": {
            "Prejoin": "-20d/h",
            "Active": "-10d+6h/h",
            "default": "None"
        }
    },
    "internal": false
}

Reference Transform usage inside the LCS Transform:

{
    "type": "dateMath",
    "attributes": {
        "expression": {
            "type": "reference",
            "attributes": {
                "input": "Prejoin",
                "id": "Look Up Values"
            }
        },
        "input": {
            "attributes": {
                "input": {
                    "attributes": {
                        "attributeName": "START_DATE",
                        "sourceName": "Auth_Source"
                    },
                    "type": "accountAttribute"
                },
                "inputFormat": "MM/dd/yyyy hh:mm:ss a z",
                "outputFormat": "ISO8601"
            },
            "type": "dateFormat"
        }
    }
}

Thankyou for your inputs.

1 Like

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