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

User response mapping from Oracle HCM(REST)

ravikumargh
New Contributor
New Contributor

Hi,

We are getting below response from Oracle HCM for phones attribute where need to pick PhoneNumber only if PhoneType=WM. 

We tried sample code mentioned in the document https://docs.saviyntcloud.com/bundle/Dev-Handbook-REST-v24x/page/Content/Developers-Handbook.htm#imp...  of the section Support for storing the objectList data but it is not working for us, Could you please help us with sample code?

ORACLE HCM RESPONSE:

{
"items": [
{
"PersonNumber": "1000001",
"emails": [
{
"EmailAddress": sendmail-test-discard@domain.com,
"EmailType": "W1"
}
],
"externalIdentifiers": [],
"names": [
{
"FirstName": "Abdul Nasir",
"MiddleNames": "******* ",
"LastName": "********"
}
],
"phones": [
{
"PhoneType": "HM",
"CountryCodeNumber": "44",
"PhoneNumber": "3173012345"
},
{
"PhoneType": "WM",
"CountryCodeNumber": "44",
"PhoneNumber": "3173054321"
}
],

.....

 

JSON we are trying:

"customproperty65": "#CONST#${List responseList = response.items.phones; int count = 0; int size = responseList.size(); Iterator iterator = responseList.iterator(); while (iterator.hasNext()){count++; Map dataMap = iterator.next(); if('HM'.equals(dataMap.PhoneType)){return dataMap.PhoneNumber}else if(count == size){return null}}}~#~char",

 

Import Result:

Code is copied to customproperty65

ravikumargh_0-1724831781565.png

[This message has been edited by moderator to mask sensitive information]

8 REPLIES 8

rushikeshvartak
All-Star
All-Star

Share full json


Regards,
Rushikesh Vartak
If this helped you move forward, click 'Kudos'. If it solved your query, select 'Accept As Solution'.

Response JSON:

{
"items": [
{
"PersonNumber": "1000001",
"emails": [
{
"EmailAddress": "sendmail-test-discard@oracle.com",
"EmailType": "W1"
}
],
"externalIdentifiers": [],
"names": [
{
"FirstName": "Mughees",
"MiddleNames": null,
"LastName": "Skinner"
}
],
"phones": [
{
"PhoneType": "W1",
"CountryCodeNumber": "353",
"PhoneNumber": "9523012345"
},
{
"PhoneType": "HM",
"CountryCodeNumber": "353",
"PhoneNumber": "31781054321"
}
],
"workRelationships": [
{
"WorkerType": "E",
"LegalEmployerName": "Saviynt IE",
"StartDate": "2021-07-05",
"TerminationDate": "2022-09-02",
"assignments": [
{
"AssignmentStatusType": "INACTIVE",
"AssignmentStatusTypeCode": "INACTIVE_PROCESS",
"ActionCode": "TERMINATION",
"AssignmentName": "Actuary",
"AssignmentNumber": "E100001",
"JobCode": "JOB_01680",
"UserPersonType": "Fixed Contractor",
"BusinessUnitName": "SIE",
"BusinessUnitId": 300000002766828,
"DepartmentId": 300000099385869,
"DepartmentName": "811201 Reporting",
"LocationCode": "LOC_GREEN",
"assignmentsDFF": [
{
"company": "AESL"
}
],
"managers": []
}
]
},
{
"WorkerType": "E",
"LegalEmployerName": "Group IE",
"StartDate": "2023-06-26",
"TerminationDate": null,
"assignments": [
{
"AssignmentStatusType": "ACTIVE",
"AssignmentStatusTypeCode": "ACTIVE_PROCESS",
"ActionCode": "REHIRE",
"AssignmentName": "Actuary",
"AssignmentNumber": "E1006958-2",
"JobCode": "JOB_00026",
"UserPersonType": "Employee",
"BusinessUnitName": "Group IE",
"BusinessUnitId": 300000002766828,
"DepartmentId": 300000099385937,
"DepartmentName": "811202 Actuarial",
"LocationCode": "LOC_GREEN",
"assignmentsDFF": [
{
"company": "SLAESL"
}
],
"managers": [
{
"ManagerAssignmentNumber": "E1004255",
"ManagerType": "LINE_MANAGER"
}
]
}
]
},
{
"WorkerType": "P",
"LegalEmployerName": "Group IE",
"StartDate": "2021-06-10",
"TerminationDate": "2021-07-04",
"assignments": [
{
"AssignmentStatusType": "INACTIVE",
"AssignmentStatusTypeCode": "INACTIVE_PROCESS",
"ActionCode": "HIRE",
"AssignmentName": "Actuary",
"AssignmentNumber": "P1006958",
"JobCode": "JOB_01680",
"UserPersonType": "Pending Worker",
"BusinessUnitName": "Group IE",
"BusinessUnitId": 300000002766828,
"DepartmentId": 300000099385869,
"DepartmentName": "811201 Reporting",
"LocationCode": "LOC_GREEN",
"assignmentsDFF": [
{
"company": null
}
],
"managers": []
}
]
},
{
"WorkerType": "P",
"LegalEmployerName": "Group IE",
"StartDate": "2023-06-22",
"TerminationDate": "2023-06-25",
"assignments": [
{
"AssignmentStatusType": "INACTIVE",
"AssignmentStatusTypeCode": "INACTIVE_PROCESS",
"ActionCode": "REHIRE",
"AssignmentName": "Actuary",
"AssignmentNumber": "P1006958-2",
"JobCode": "JOB_00026",
"UserPersonType": "Pending Worker",
"BusinessUnitName": "Group IE",
"BusinessUnitId": 300000002766828,
"DepartmentId": 300000099385937,
"DepartmentName": "811202 aand",
"LocationCode": "LOC_GREEN",
"assignmentsDFF": [
{
"company": null
}
],
"managers": []
}
]
}
]
},
{
"PersonNumber": "1007031",
"emails": [
{
"EmailAddress": "sendmail-test-discard@oracle.com",
"EmailType": "W1"
}
],
"externalIdentifiers": [],
"names": [
{
"FirstName": "Codey",
"MiddleNames": null,
"LastName": "Sachdev"
}
],
"phones": [],
"workRelationships": [
{
"WorkerType": "C",
"LegalEmployerName": "Group UK",
"StartDate": "2021-06-16",
"TerminationDate": null,
"assignments": [
{
"AssignmentStatusType": "ACTIVE",
"AssignmentStatusTypeCode": "ACTIVE_NO_PROCESS",
"ActionCode": "ASG_CHANGE",
"AssignmentName": "Contractor",
"AssignmentNumber": "C1007031",
"JobCode": "JOB_01158",
"UserPersonType": "Managed Services ",
"BusinessUnitName": "Group",
"BusinessUnitId": 300000002766815,
"DepartmentId": 300000002782252,
"DepartmentName": "113103 IT Management",
"LocationCode": "HOUSE",
"assignmentsDFF": [
{
"company": "SLAESL"
}
],
"managers": [
{
"ManagerAssignmentNumber": "C17819",
"ManagerType": "LINE_MANAGER"
}
]
}
]
}
]
}
],
"count": 10,
"hasMore": true,
"limit": 10,
"offset": 0,
"links": [
{
"rel": "self",
"href": "https://domain.com:443/hcmRestApi/resources/11.13.18.05/workers ",
"name": "workers",
"kind": "collection"
}
]
}

[This message has been edited by moderator to mask sensitive information]

NM
Honored Contributor II
Honored Contributor II

Hi @ravikumargh is items a list field used in connection?

ravikumargh
New Contributor
New Contributor

not sure what it means, but we have "userResponsePath": "items", in the ImportUserJSON

Share full ImportUserJSON‼️‼️⚠️Keep company-specific private information masked on public forums, such as the name and URL.⚠️‼️‼️

 


Regards,
Rushikesh Vartak
If this helped you move forward, click 'Kudos'. If it solved your query, select 'Accept As Solution'.

NM
Honored Contributor II
Honored Contributor II

Hi @ravikumargh ,

Try this

"customproperty65": "#CONST#${List responseList = response.phones; int count = 0; int size = responseList.size(); Iterator iterator = responseList.iterator(); while (iterator.hasNext()){count++; Map dataMap = iterator.next(); if('HM'.equals(dataMap.PhoneType)){return dataMap.PhoneNumber}else if(count == size){return null}}}~#~char",

ravikumargh
New Contributor
New Contributor

response.phones worked thanks, I have similar problem and posted in another post, could you please check and help? https://forums.saviynt.com/t5/identity-governance/nested-object-iterations-in-rest-oracle-hcm-connec...

ganimkt
New Contributor II
New Contributor II

Hi @ravikumargh,

You can try the below one also it's working for me.

"customproperty65": "#CONST#${List responseList = response?.phones; boolean hasEmailAddress = false; for (Map dataMap : responseList) { if ('HM'.equals(dataMap.PhoneType)) {return dataMap.PhoneNumber}}}~#~char",