Velocity transform implicit input

Hi All,

Does the static velocity transform inject a known variable for implicit input, such as $input or $implicitInput?

I’m trying to create something re-usable for date fields which occur in multiple places in my source directory. So that I don’t create 5 rules for 5 dates (using multiple accountAttribute). I found I can basically create a NoOp using Trim(), but would like to know if there’s a cleaner way?

Working:

{
        "name": "Plain Date to UTC Date",
        "type": "static",
        "attributes": {
            "utcOffset": {
                "attributes": {
                    "sourceName": "MySource",
                    "attributeName": "utcOffset"
                },
                "type": "accountAttribute"
            },
            "dateNoOp": {
                
                "type": "trim",
                "name": "Trim Transform"
                },

            "value": "$dateNoOp $utcOffset"
        },
        "internal": false
    }

Is there something I’m missing in the documentation that would allow for this:

{
        "name": "Plain Date to UTC Date",
        "type": "static",
        "attributes": {
            "utcOffset": {
                "attributes": {
                    "sourceName": "MySource",
                    "attributeName": "utcOffset"
                },
                "type": "accountAttribute"
            },
            "value": "$implicitInput $utcOffset"
        },
        "internal": false
    }

I’ve tried input, implicitInput, and value. I’m functional with my workaround, but wondering if there’s a cleaner approach?

Hi @mdewallnc

I did think about this, if we can use the implicit input. But it won’t work unlike other Transform operations.

As per SailPoint docs,

Use the static transform to return a fixed string value, or more commonly, to evaluate Velocity Template Language. The latter implementation is often useful when you are using if/then/else logic or iterating through a for loop. The static transform can also take other dynamically provided variables as inputs into the value attribute.

So, no. Your 1st Transform is the best way to avoid multiple Transforms for similar requirements.

{
        "name": "Plain Date to UTC Date",
        "type": "static",
        "attributes": {
            "utcOffset": {
                "attributes": {
                    "sourceName": "MySource",
                    "attributeName": "utcOffset"
                },
                "type": "accountAttribute"
            },
            "dateNoOp": {
                "type": "trim"
            },
            "value": "$dateNoOp $utcOffset"
        },
        "internal": false
    }

Thanks
Krish

4 Likes

instead of this use

dateNoOp": {                
     "type": "trim",
     "attributes": null
},

dateNoOp will take implicit input.

You don’t need another transform

Got it, thank you Krishna. Wish this was a little cleaner, but as long as I name things appropriately the next person in line to support my work will be able to understand what I’m doing here.

Matt

1 Like

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