Click HERE to see how Saviynt Intelligence is transforming the industry. |
04/12/2022 01:14 PM
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?
Solved! Go to Solution.
04/12/2022 02:38 PM
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
04/12/2022 02:38 PM
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!