User Name create with Prefix - Second eye check

Hello All,

I had a last min user case come up that when the account type comes in as a Bot or anything else it needs to add it to the form of the first name of the identity username of the account. I am getting the SVC_ infront but i am not getting the first name added to it.

Needs to come in as SVC_“Firstname” or SVCBOT_“Firstname”.

Can i just get a quick look as I never have seen this output outside a error if i had the $ in front. Totally stumpped today

{
    "type": "concat",
    "attributes": {
        "values": [
            "prefix",
            {
                "attributes": {
                    "sourceCheck": true,
                    "patterns": [
                        "$fn"
                    ],
                    "fn": {
                        "type": "identityAttribute",
                        "attributes": {
                            "name": "firstname"
                        }
                    }
                }
            },
            {
                "attributes": {
                    "input": {
                        "attributes": {
                            "name": "serviceAccountType"
                        },
                        "type": "identityAttribute"
                    },
                    "table": {
                        "BOT": "SVCRPA_",
                        "default": "SVC_"
                    }
                },
                "type": "lookup",
                "name": "Lookup Transform"
            },
            "prefix"
        ]
    },
    "internal": false
}

Hi @VBsupport,

can you explain again what you need extacly ?

Based of what i understand, i think about this trnasform :

{
    "type": "static",
    "attributes": {
        "fn": {
            "type": "identityAttribute",
            "attributes": {
                "name": "firstname"
            }},
            "accountTypeValue": {
                "attributes": {
                    "name": "serviceAccountType"
                },
                "type": "identityAttribute"
            },
            "value": "#if($accountTypeValue=='BOT')SVCRPA_$fn#{else}SVC_$fn"
        },
    "internal": false
}

Yes,

I have a firstname comming into from the file source. depending on the account type, if it is a BOT then it needs to added SVCRPA_plus the first name to make the Sailpoint UID name. If it is any other account type then it is just SVC_FirstName.

Sample:

Account Type: BOT
FIrst Name: ACME
Result: SVCRPA_ACME

OR

Account Type: Application
FirstName: Bob
Result: SVC_Bob

Ousmane provided an excellent response and I think that may be a great solution.

Make sure that the variables in the value are surrounded by curly braces; if a variable is next to text, ISC will consider it to be a part of the string and not use the variable value.

Correct Usage:
"value": "#if($accountTypeValue=='BOT')SVCRPA_${fn}#{else}SVC_${fn}"

2 Likes

Not sure why I didn’t think about using if statement.
Sounds solid and I will have to think simpler. However, for this
I did try you value however it gave me a render error.

{
    "type": "static",
    "attributes": {
        "fn": {
            "type": "identityAttribute",
            "attributes": {
                "name": "firstname"
            }
        },
        "accountTypeValue": {
            "attributes": {
                "name": "serviceAccountType"
            },
            "type": "identityAttribute"
        },
        "value": "#if($accountTypeValue=='BOT')SVCRPA_${fn}#{else}SVC_${fn}"
    },
    "internal": false
}

image

Looks like you’re missing the end statement. Try this:

#if($accountTypeValue=='BOT')SVCRPA_${fn}#{else}SVC_${fn}#end

2 Likes

I see you got the answer before me the end tag was missing :slight_smile:

3 Likes

OMG - I just saw that too as you pointed it out. Sometime you don’t even realize it when are moving a mile a min. Thanks everyone…

2 Likes

Good news !
After write template i do not test it and i forget #end

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