# Username generator fail

**URL:** <https://developer.sailpoint.com/discuss/t/username-generator-fail/29612>\
**Category:** SHF Discussion and Questions\
**Tags:** transforms, sailpoint-identity-security\
**Created:** [February 8, 2024, 7:25pm UTC](https://developer.sailpoint.com/discuss/t/username-generator-fail/29612 "2024-02-08T19:25:32Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![gsierra](https://avatars.discourse-cdn.com/v4/letter/g/d2c977/32.png) [@gsierra](https://developer.sailpoint.com/discuss/u/gsierra)\
**Post date:** [February 8, 2024, 7:25pm UTC](https://developer.sailpoint.com/discuss/t/username-generator-fail/29612/1 "2024-02-08T19:25:33Z")

</div>

Hello everyone  
I have a problem with the username generator. I am using the following transformation to set the value of AD userPrincipalName:

```auto
{
  "attributes": {
    "cloudMaxSize": "100",
    "cloudMaxUniqueChecks": "25",
    "cloudRequired": "true"
  },
  "isRequired": false,
  "multi": false,
  "name": "userPrincipalName",
  "transform": {
    "type": "usernameGenerator",
    "attributes": {
      "sourceCheck": true,
      "patterns": ["$fi$ln${uniqueCounter}"],
      "ln": {
        "type": "identityAttribute",
        "attributes": {
          "name": "lastname"
        }
      },
      "fi": {
        "type": "substring",
        "attributes": {
          "input": {
            "type": "identityAttribute",
            "attributes": {
              "name": "firstname"
            }
          },
          "begin": 0,
          "end": 1
        }
      }
    }
  },
  "type": ""
}

```

However, I am getting the error:

**Stopped processing username creation for pattern: $fi$ln${uniqueCounter} because maximum attempts reached: 25**

Why is it not working?

---

<div class="post-metadata">

**Author:** ![ethompson](https://sea1.discourse-cdn.com/sailpoint/discuss/user_avatar/developer.sailpoint.com/ethompson/32/17298_2.png) [@ethompson](https://developer.sailpoint.com/discuss/u/ethompson)\
**Post date:** [February 8, 2024, 8:03pm UTC](https://developer.sailpoint.com/discuss/t/username-generator-fail/29612/2 "2024-02-08T20:03:22Z")

</div>

Can you repost this in the Discussion and Questions Category?

---

<div class="post-metadata">

**Author:** ![sjoyee](https://avatars.discourse-cdn.com/v4/letter/s/3ec8ea/32.png) [@sjoyee](https://developer.sailpoint.com/discuss/u/sjoyee)\
**Post date:** [February 15, 2024, 8:11am UTC](https://developer.sailpoint.com/discuss/t/username-generator-fail/29612/3 "2024-02-15T08:11:10Z")

</div>

Hi @gsierra, I believe is because you specified `"cloudMaxUniqueChecks": "25"` in your script. The generator exhausts the “cloudMaxUniqueChecks” value and still does not find a unique value, and thus the error.

The maximum allowed value for this field is 50.

For more information, you can read from this documentation: [Username Generator | SailPoint Developer Community](https://developer.sailpoint.com/idn/docs/transforms/operations/username-generator).

Hope this helps.

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/sailpoint/original/2X/f/f2136700ed5e3703e0b85e02f6be799dacca7735.png) [@system](https://developer.sailpoint.com/discuss/u/system)\
**Post date:** [April 15, 2024, 8:11am UTC](https://developer.sailpoint.com/discuss/t/username-generator-fail/29612/4 "2024-04-15T08:11:29Z")

</div>

Closed on April 15, 2024, 8:11am UTC

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