Get Reference Identity Attribute with manager keyword throws error when identity has no manager

I have a transform (from here) that reads a specific attribute from manager’s identity. However, when the identity does not have a manager this transform throws error resulting in identity to have the error and not calculate some other attributes.

I have tried to wrap the transform with firstValid, but this did not help.

Any idea how do I deal with this situation?

Hi @iamology ,

To handle errors in transforms when an identity doesn’t have a manager, specifically for the getReferenceIdentityAttribute transform, you can use the “ignoreErrors” attribute set to true. This allows the transform to continue processing even if an error occurs when trying to access the manager’s attributes.

{
  "attributes": {
    "ignoreErrors": "true",
    "values": [
      {
        "attributes": {
          "name": "Cloud Services Deployment Utility",
          "operation": "getReferenceIdentityAttribute",
          "uid": "manager",
          "attributeName": "email"
        },
        "type": "rule"
      },
      "None"
    ]
  },
  "name": "Get Manager Email Transform",
  "type": "firstValid"
}

In this, the transform attempts to get the manager’s email attribute. If the identity doesn’t have a manager or if there’s any other error, it will return “None” as the fallback value. You can replace “None” with any other appropriate fallback value or transform based on your specific requirements.

1 Like

Hi @iamology !

What attribute are you trying to set with the transform? The first valid should have helped, what options did you set if the manager wasn’t valid?

For example if you’re trying to set a manager email, the first valid options could be something like $identity.manager.email then “no-email@domain.com”

1 Like

bed gf

Not sure why did the firstValid transform work first time, but it seems to be working now.

Thanks!!!

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