Saviynt unveils its cutting-edge Intelligence Suite products to revolutionize Identity Security!
Click HERE to see how Saviynt Intelligence is transforming the industry.
Saviynt Copilot Icon

REST connector - get specific array object in response to map to saviynt attribute

Community_User
Saviynt Employee
Saviynt Employee
Originally posted on September 27 2021 at 20:39 UTC

Any idea how I would be able to map a specific object of a returned array instance to a saviynt attribute ( ImportserJSON) ?


For eg, the result from REST Import looks like this, where "results" is an array of two entries with different addressType (mail and home).


{

"homeAddressNavDEFLT": {

                    "results": [

                        {

                            "addressType": "mail",

                            "country": "CAN",

                            "zipCode": "01234"

                        },

                        {

                            "addressType": "home",

                            "country": "USA",

                            "zipCode": "12321"

                        }

                    ]

                }

}                



I need to map the country where addressType = "home", so in this case "USA". I cannot use an array index as this may or may not be the 1st element in the array returned.


I tried 

  "customproperty36": "homeAddressNavDEFLT.results.find {it.addressType== 'home'}?.country~#~char",

   

Doesnt work. Any ideas?

This message was previously posted on Saviynt's legacy forum by a community user and has been moved over to this forum for continued exposure.
2 REPLIES 2

Community_User
Saviynt Employee
Saviynt Employee
Originally posted on September 29 2021 at 16:40 UTC

Ajit,


The support for this feature was introduced in v5.5 SP3.8. The release notes is shared below, Please look for the details for CONN-986 under Connectors section.

https://saviynt.freshdesk.com/a/solutions/articles/43000630420


As per the example,  I could gather, here's how you can use this feature, to get the desired results.


Use Case : API returns multiple emailType, need to use only email address if the emailType is 312.


"email": "#CONST#${List responseList = response.empInfo.personNav.emailNav.results; int count = 0; int size = responseList.size(); Iterator iterator = responseList.iterator(); while (iterator.hasNext()){count++; Map dataMap = iterator.next(); if('312'.equals(dataMap.emailType)){return dataMap.emailAddress}else if(count == size){return null}}}~#~char",



This is also available in the documentation under "Support for storing the objectList data" : https://saviynt.freshdesk.com/a/solutions/articles/43000521736





Regards,

Avinash Chhetri




This message was previously posted on Saviynt's legacy forum by a community user and has been moved over to this forum for continued exposure.

Community_User
Saviynt Employee
Saviynt Employee
Originally posted on September 29 2021 at 16:43 UTC

Thats great news! Thanks Avinash. We have v5.5SP3 at this time. For now I have mitigated this by using Preprocessing, but will see if we can get upgraded to SP8 and will try this out. Thanks again!


This message was previously posted on Saviynt's legacy forum by a community user and has been moved over to this forum for continued exposure.