Unique Counter is not working

:bangbang: Please be sure you’ve read the docs and API specs before asking for help. Also, please be sure you’ve searched the forum for your answer before you create a new topic.

Please consider addressing the following when creating your topic:

  • What have you tried?

    I am using this transform to provision the mailNickName attribute for ADM accounts, but it is failing to ensure uniqueness when multiple users share the same last name.

  • What errors did you face (share screenshots)?
    not error came but it’s generating without appending any unique values

  • Share the details of your efforts (code / search query, workflow json etc.)?

    {
    
                "name": "mailNickname",
    
                "transform": {
    
                    "type": "usernameGenerator",
    
                    "attributes": {
    
                        "sourceCheck": "true",
    
                        "patterns": [
    
                            "adm_az_${fi}${ln}",
    
                            "adm_az_${fi}${ln}${uniqueCounter}"
    
                        ],
    
                        "ln": {
    
                            "type": "lower",
    
                            "attributes": {
    
                                "input": {
    
                                    "type": "replace",
    
                                    "attributes": {
    
                                        "regex": "[^a-zA-Z]",
    
                                        "replacement": "",
    
                                        "input": {
    
                                            "type": "identityAttribute",
    
                                            "attributes": {
    
                                                "name": "lastname"
    
                                            }
    
                                        }
    
                                    }
    
                                }
    
                            }
    
                        },
    
                        "fi": {
    
                            "type": "substring",
    
                            "attributes": {
    
                                "begin": 0,
    
                                "end": 1,
    
                                "input": {
    
                                    "type": "lower",
    
                                    "attributes": {
    
                                        "input": {
    
                                            "type": "replace",
    
                                            "attributes": {
    
                                                "regex": "[^a-zA-Z]",
    
                                                "replacement": "",
    
                                                "input": {
    
                                                    "type": "identityAttribute",
    
                                                    "attributes": {
    
                                                        "name": "firstname"
    
                                                    }
    
                                                }
    
                                            }
    
                                        }
    
                                    }
    
                                }
    
                            }
    
                        }
    
                    }
    
                },
    
                "attributes": {
    
                    "cloudMaxUniqueChecks": "25",
    
                    "cloudMaxSize": "100",
    
                    "cloudRequired": "true"
    
                },
    
                "isRequired": false,
    
                "type": "string",
    
                "isMultiValued": false
    
            }
    
  • What is the result you are getting and what were you expecting?

I am excepting, two users with a same last Name, for second user it should append numeric value ‘1’

Hey, @gbalag you are passing the source check value as a string, but it is actually a boolean. change it to "sourceCheck": true,

LMK if this change works.

Hi @Santhakumar ,

I included that change in above code, but it’s not working even though.

Are you sure is failing on that attribute and not any of the other ones that need to be unique?

Hi @gbalag You need to use Create Unique LDAP Attribute generator for attributes which aren’t the account name

See Account Profile Attribute Generator (from Template) | SailPoint Developer Community

Hi @j_place ,

I am using the userprincipalName attribute following same logic, userprincipalName is account Name attribute for that also uniqueness is not working

i added code below

 {

            "name": "userPrincipalName",

            "transform": {

                "type": "usernameGenerator",

                "attributes": {

                    "sourceCheck": "true",

                    "patterns": [

                        "adm_az_${fi}${ln}@eaholding.onmicrosoft.com",

                        "adm_az_${fi}${ln}${uniqueCounter}@eaholding.onmicrosoft.com"

                    ],

                    "ln": {

                        "type": "lower",

                        "attributes": {

                            "input": {

                                "type": "replace",

                                "attributes": {

                                    "regex": "[^a-zA-Z]",

                                    "replacement": "",

                                    "input": {

                                        "type": "identityAttribute",

                                        "attributes": {

                                            "name": "lastname"

                                        }

                                    }

                                }

                            }

                        }

                    },

                    "fi": {

                        "type": "substring",

                        "attributes": {

                            "begin": 0,

                            "end": 1,

                            "input": {

                                "type": "lower",

                                "attributes": {

                                    "input": {

                                        "type": "replace",

                                        "attributes": {

                                            "regex": "[^a-zA-Z]",

                                            "replacement": "",

                                            "input": {

                                                "type": "identityAttribute",

                                                "attributes": {

                                                    "name": "firstname"

                                                }

                                            }

                                        }

                                    }

                                }

                            }

                        }

                    }

                }

            },

            "attributes": {

                "cloudMaxUniqueChecks": "25",

                "cloudMaxSize": "100",

                "cloudRequired": "true"

            },

            "isRequired": false,

            "type": "string",

            "isMultiValued": false

        }

Apols, when I said Account Name, I meant Account ID. The username generator can be used for DN on an AD source. For all other attributes with a uniqueness requirement use the Create Unique LDAP Attribute.

Hi @gbalag

Could you confirm if the following is true for your transform setup?

sure @j_place , could you please conform, create LDAP Attribute will handle,
my requirement

  1. i want to the make lowercase my attribute (eg . Frist Name, last Name)
  2. handle the special characters
  3. handle spaces

is this possible in that rule :slightly_smiling_face: ?

Hi @ksbagade , yes, it got handled

You can nest other transforms just as you do with username generator. Think of it as a transform of Rule type.

@gbalag - Did you get this sorted?