Velocity lookup table in a transform

Use case: AD OU placement needs to be populated for object move events, such as on termination. HR Source handles multiple types of employee types with different structure on given HR data. In trying to build one transform, it may take a lot of if then else type statements and the ability to do a lookup based on the type of employee type they are.

Question:
Is it possible to use something within Velocity to do a lookup in possibly several tables / hash tables? If it is possible can you help show me a simple format of what that might look like?

If employee type is equal to Contractor and job code is 99 get the cost center and lookup a given hash table to see what container they are placed in.

If the employee type is equal to employee and they are on campus xyz check their job code in given hash table to find what OU they can reside in.

Since we have multiple employee types on the same source and the data isn’t mirroring other types, we have to look at some complex logic. I can see a rule doing this, but every time the rule needs an update, we are having to modify the rule. I have heard that you can have a rule that does a lookup to a delimited text source, but we already are using a before provisioning rule on the connector.

Here is a basic example of having multiple tables and depending on the if condition, use the value of a different table. You may need to also add additional values like Job Code and explicitly adding the input to the lookup table as the cost center.

{
    "name": "Example",
    "type": "static",
    "attributes": {
        "table1": {
            "type": "lookup",
            "attributes": {
                "table": {
                    "key1": "value1",
                    "key2": "value2",
                    "default": "value"
                }
            }
        },
        "table2": {
            "type": "lookup",
            "attributes": {
                "table": {
                    "key1": "value1",
                    "key2": "value2",
                    "default": "value"
                }
            }
        },
        "type": {
            "type": "accountAttribute",
            "attributes": {
                "sourceName": "HR",
                "attributeName": "employeeType"
            }
        },
        "value": "#if($type == 'Contractor')$table1#{else}$table2"
    }
}

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