Transform mail if empy value

I’m having difficulty creating a “transform” to use the mail attribute of a source (active directory account) and if the source’s email field is empty, fill it with static text.

{
    "name": "First Valid Mail field",
    "type": "firstValid",
                "attributes": {
                    "values": [
                        {
                        "type": "accountAttribute",
                            "attributes": {
                            "sourceName": "AD Homolog - user",
                            "attributeName": "mail",
                            },
                        },
                        {
                        "type": "static",
                                "attributes": {
                                "value": "[email protected]"
                                },
                        },
                    ]
                },
}

Hi @caofrancoso

Welcome to SailPoint developer community.

Your Transform is correct but JSON formatting is incorrect. Use the below Transform.

{
    "name": "First Valid Mail field",
    "type": "firstValid",
    "attributes": {
        "values": [
            {
                "type": "accountAttribute",
                "attributes": {
                    "sourceName": "AD Homolog - user",
                    "attributeName": "mail"
                }
            },
            {
                "type": "static",
                "attributes": {
                    "value": "[email protected]"
                }
            }
        ]
    }
}

Thanks
Krish

1 Like

It worked perfectly, thank you very much!

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