Will identity Profile mapping - memberOf attribute only gets first value?(NO Transform)

Hi All,

I have added a attribute on identity profile mappings and trying to get memberOf values for a identitywith NO TRANSFORM added yet but in the preview, I only see one value. I want to know if it will read all the memberOf attributes so I can apply transform.
Please let me know how this attribute works. TIA

Hi

You get only one value by default when you read multi-valued attribute.

If your requirement is to check if user has a specific group or not then you can use below Transform.

{
    "name": "MultiValued Static Transform",
    "type": "static",
    "attributes": {
        "HasABC": {
            "attributes": {
                "values": [
                    {
                        "type": "accountAttribute",
                        "attributes": {
                            "attributeName": "anyAccountAttribute",
                            "sourceName": "sourceName",
                            "accountPropertyFilter": "(attributeName.contains(\"ABC\"))"
                        }
                    },
                    {
                        "attributes": {
                            "value": "none"
                        },
                        "type": "static"
                    }
                ]
            },
            "type": "firstValid"
        },
        "value": "#if ($HasABC != 'none') Yes #else No #end"
    },
    "internal": false
}

Thanks
Krish

4 Likes

Thanks @MVKR7T , This is helpful, let me build the transform and see if it works.

1 Like

If you would like to display all the Groups for a user, you can use below Transform.

{
	"name": "Get Multi Values Static Transform",
	"type": "static",
	"attributes": {
		"value": "#foreach($link in $identity.getLinksByAppIdOrName(\"source name or id\",null))#if($foreach.index + 1 != $identity.getLinks().size())$link.getAttribute("memberOf")(),#else$link.getAttribute("memberOf")#end#end"
	},
	"internal": false
}
7 Likes

Hi @MVKR7T,

That’s cool.

Can this transform be used for getting any of the multivalued attributes from a source into an Identity attribute.? or this is limited to only the memberof value.?

It works for any attribute, basically you are iterating user account(s) and extracting account attributes. Even I didn’t know that this is supported till this discussion, check it has good info.

3 Likes

This transforms works for me.Thanks @MVKR7T

{
“name”: “Get Multi Values Static Transform”,
“type”: “static”,
“attributes”: {
“value”: “#foreach($link in $identity.getLinksByAppIdOrName("source name or id",null))#if($foreach.index + 1 != $identity.getLinks().size())$link.getAttribute(“memberOf”)(),#else$link.getAttribute(“memberOf”)#end#end”
},
“internal”: false
}

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