Nesting Transforms limit?

Good morning,
I have a transform that works perfectly, but when I reference it (not the output) in another transform, the innermost nesting fails intermittently. Is there a limit to the number of nesting that can occur?
This part of the transform that works, and it is the ‘firstValid’ part that fails upon referencing:
Any help would be gratefully received.

      {
        "type": "replace",
        "attributes": {
          "input": {
            "type": "lower",
            "attributes": {
              "input": {
                "type": "static",
                "attributes": {
                  "value": {
                    "type": "reference",
                    "attributes": {
                      "id": "Specsavers Diacritical Marks",
                      "input": {
                        "type": "concat",
                        "attributes": {
                          "values": [
                            {
                              "type": "firstValid",
                              "attributes": {
                                "values": [
                                  {
                                    "type": "accountAttribute",
                                    "attributes": {
                                      "sourceName": "ServiceNow Test – NE",
                                      "name": "Tussenvoegsel"
                                    }
                                  },
                                  ""
                                ]
                              }
                            },
                            {
                              "type": "identityAttribute",
                              "attributes": {
                                "name": "lastname"

And this is part of the referencing transform, its the last statement in a firstValid:

          {
              "attributes": {
                  "variable1": {
                    "type": "reference",
                      "attributes": {
                          "id": "SystemID Default Calculate"
                      }

I can add the full transforms if needed.
Thanks

I’m not aware of any nesting limits. Does it always fail when referenced, or does it appear to fail randomly?

You say it works perfectly as-is, but fails on reference. Can you tell us which identity profile and identity attribute you applied it to as-is vs when you referenced it?

It appears to fail randomly.
It is applied to all profiles and it is the identity.attribute systemIdDefault.
If it just preferredName.lastName, this does not fail when referenced, but for our Dutch colleagues, we need to add the ‘Tussenvoegsel’ (ie: van der) if present.
This is then referenced to create the attribute. sAMAccountName - which runs through a unique counter rule, in the provisioning rules, then applied to identity.attribute.sAMAccountname

In testing, I replaced
{
“type”: “accountAttribute”,
“attributes”: {
“sourceName”: “ServiceNow Test – NE”,
“name”: “Tussenvoegsel”
}
with
“type”: “static”,
“value” “Tussen”

And in this instance, the output for the SystemIdDefault was preferredName.tussenlastName (correct)
and the referenced output was: preferredName.tussen. Where the concat failed to add the lastName.

This is why I was questioning a limit to nesting. Or is it a race condition? Would adding a ‘wait’ to the beforeProvisioning rule for Global AD account creation allow the IDN cube to settle?

I’m having a hard time seeing what the issue could be. This doesn’t look like a nesting issue.
Access to your tenant to do a deeper investigation would be ideal, which is something our professional services team can help with. It might be worth checking with your customer success manager to see if you have any PS engagement hours that you can leverage.

It is definitely a nesting problem. I reworked the referencing transform and removed a layer and in now works everytime:
It was this:

{
    "id": "9f81fb7e-b104-4304-9e43-4340b02089b8",
    "name": "sAMAccountName - Calculate",
    "type": "firstValid",
    "attributes": {
        "values": [
            {
                "attributes": {
                    "attributeName": "sAMAccountName",
                    "sourceName": "AD Global"
                },
                "type": "accountAttribute"
            },
            {
                "attributes": {
                    "variable1": {
                        "type": "reference",
                        "attributes": {
                            "id": "SystemID Default Calculate"
                        }
                    },
                    "value": "#if($variable1.length() < 19)$variable1#{elseif}($variable1.substring(17,18).equals('.'))$variable1.substring(0,17)#{else}$variable1.substring(0,18)#end"
                },
                "type": "static"
            }
        ]
    },
    "internal": false
}

and now it is this:

{
  "name": "sAMAccountNameDefault - Calculate",
  "type": "static",
  "attributes": {
    "variable1": {
      "type": "reference",
      "attributes": {
        "id": "SystemID Default Calculate"
      }
    },
    "value": "#if($variable1.length() < 19)$variable1#{elseif}($variable1.substring(17,18).equals('.'))$variable1.substring(0,17)#{else}$variable1.substring(0,18)#end"
  }
}

However, thank you for looking into it for me. We work with a consulting firm called CyberIAM, and they were stuck on how to proceed too, which is why I raised it here.

Glad it’s working now. However, I want to bring this to engineering to confirm if there is a nesting limit or not. Can you please DM me the full JSON for the transform so engineering can analyze it?