userPrincipalName first valid only returning "none"

Hi Team,

I have a transform that I need to place a static value of [email protected] in the userprincipalname and mail field in Active Directory but it is just returning none. I know it is returning none because there is not an email present but how do I get it to just add the value?

I feel like I am missing one detail?

{
    "id": "ed20e510-a79a-45a5-a7d7-a03ce7d3b0e7",
    "name": "UPN Transform",
    "type": "static",
    "attributes": {
        "email": {
            "type": "firstValid",
            "attributes": {
                "values": [
                    {
                        "attributes": {
                            "sourceName": "Active Directory",
                            "attributeName": "mail"
                        },
                        "type": "accountAttribute"
                    },
                    {
                        "attributes": {
                            "sourceName": "Active Directory",
                            "attributeName": "userPrincipalName"
                        },
                        "type": "accountAttribute"
                    },
                    {
                        "attributes": {
                            "sourceName": "Active Directory",
                            "attributeName": "sAMAccountName"
                        },
                        "type": "accountAttribute"
                    },
                    {
                        "attributes": {
                            "value": "none"
                        },
                        "type": "static"
                    }
                ]
            }
        },
        "staticString": {
            "type": "static",
            "attributes": {
                "value": "@domain.com"
            }
        },
        "value": "$email"
    },
    "internal": false
}

Hi @mgrant ,

Do you want to update blank value if its none? like just @domain.com?

For updating UPN value, it should be like $mail where you can simply get “mail” attribute from AD and update the same or it should be [email protected]

{
    "id": "ed20e510-a79a-45a5-a7d7-a03ce7d3b0e7",
    "name": "UPN Transform",
    "type": "static",
    "attributes": {
        "sAMAcntName": {
            "type": "firstValid",
            "attributes": {
                "values": [                  
                    {
                        "attributes": {
                            "sourceName": "Active Directory",
                            "attributeName": "sAMAccountName"
                        },
                        "type": "accountAttribute"
                    },
                    "null"
                ]
            }
        },        
        "value": "[email protected]"
    },
    "internal": false
}
1 Like

Hi @mgrant ,
Greetings of the Day!

Check the below screenshot we can add directly in Create Account session.

Note: Add samaccountname attribute first and then next mail ,UPN.
Thank You
Mahesh M

Hi Theja,

Thanks for chiming in. This solution worked for the UPN value for me. My logic was overcomplicating things.

Hi Mahesh,

I had the mail attribute set to point to an identity attribute but did not think to add a static value on the create profile. This is a much simpler solution as well. I’ll follow your recommendation.

You both have helped me out tremendously by assisting me with developing less complicated solutions. I truly appreciate the help.

2 Likes

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