Account Attribute Transform using IdentityAttribute in AccountFilter

Hello Everyone,

We are facing a problem with an account attribute transform.

We are using an accountfilter based on the account name (displayname) and it is working fine if the value is static. But our goal is to use the filter if the displayname equals to an identityattribute.

We tried with this transform but it is not working, it is working if i replace the idAccount variable to an static value

{
    "name": "Calculate actual Job",
    "type": "static",
    "attributes": {
        "idAccount": {
            "type": "identityAttribute",
            "attributes": {
                "name": "idJob"
            }
        },
        "job": {
            "type": "accountAttribute",
            "attributes": {
                "sourceName": "SourceJobs",
                "attributeName": "Job",
                "accountFilter": "(displayName == \"$idAccount\")"
            }
        },
        "value": "$job"
    },
    "internal": false
}

From my experience, accountFilter only takes in a static string.

The “idAccount” variable is only available in the “value” tag. It is not available in the “job” tag. You’d need to refactor this if you want the “accountAttribute” lookup to work. Also, the accountAttribute transform only looks up values on accounts that are associated to the user - which, maybe they are in this scenario, I’m just having a bit of a hard time envisioning what this source looks like.

Assuming the “SourceJobs” records are correlated to the user, you could refactor the transform to look something like this:

{
    "name": "Calculate actual Job",
    "type": "accountAttribute",
    "attributes": {
        "sourceName": "SourceJobs",
        "attributeName": "Job",
        "accountFilter": {
            "attributes":{
                "idJob":{
                   "type": "identityAttribute",
                    "attributes": {
                        "name": "idJob"
                    }
                },
                "value": "(displayName == \"$idJob\")"
            },
            "type":"static"
        }
    },
    "internal": false
}

And I haven’t tested, but I kind of think something like the following might actually work:

{
    "name": "Calculate actual Job",
    "type": "accountAttribute",
    "attributes": {
        "sourceName": "SourceJobs",
        "attributeName": "Job",
        "accountFilter": "(displayName == \"$identity.attributes.idJob\")"
    },
    "internal": false
}

Thanks @KevinHarrington

The correct way was the first code.

Kind regards,

Pablo

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