Get complete account details with one call of Account Attribute Transform

Greetings,
I am working with a client where the users will have multiple accounts in same source and each account will have the account status True / False. The transforms needs to use the value from the active account and if no active accounts are present then transforms should use the data from inactive account.
We can use the “accountPropertyFilter” to filter the active accounts and by wrapping the logic inside a firstValid transform we will be able to get the active account data and if active account not present then I will use the data from inactive account.

{
    "type": "firstValid",
    "attributes": {
        "values": [
            {
                "type": "accountAttribute",
                "attributes": {
                    "sourceName": "TestSource",
                    "attributeName": "Email",
                    "accountPropertyFilter": "(isActive == \"true\")"
                }
            },
            {
                "type": "accountAttribute",
                "attributes": {
                    "sourceName": "TestSource",
                    "attributeName": "Email",
                    "accountPropertyFilter": "(isActive == \"false\")"
                }
            },
            "[email protected]"
        ]
    }

Is there anyway that we can get the required data once and use it through out the transform instead of using this same code for at all loctions for different variables? I am trying to avoid the above code block whenever I need to use the Account Attribute Transform.
Appriciate any help or thoughts…!
Thankyou.

Hi @Keethanmadalab,

Have you considered making use of a reference transform.?

That way, you can create a transform to get the account name and reference it in other transforms when required.

Else, you can consider creating an Identity attribute to store the account value based on this firstValid transform. Then make use of an Identity context to call this transformed value in other operations.

1 Like

@jesvin90 Thankyou for your advise. I will try the approach to have a stand alone transform and try referencing it.