JSON Path Attribute Mapping

  • Oracle Fusion HCM source now respects the JSON path query mentioned for specified attribute mapping of non-out-of-the-box attributes.

Let us understand from the following API response as an example and how to specify the JSON path query for the workRelationships attribute:

"workRelationships": [

{

"PeriodOfServiceId": 300000034528102,

"LegislationCode": "IN",

"WorkerType": "E",

"PrimaryFlag": true,

"StartDate": "2022-08-11",

"assignments": [

{ "AssignmentId": 300000034528108,

… }

]

},

"PeriodOfServiceId": 300000034528226,

"LegislationCode": "IN",

"WorkerType": "N",

"PrimaryFlag": false,

"StartDate": "2022-08-23",

"assignments": [

{"AssignmentId": 300000034528233,

… }

]

Case 1: If concurrent workRelationships is active and you want to fetch the attribute from Primary workRelationships such as PeriodOfServiceId, then the JSON path for attribute mapping is:

workRelationships[?(@.PrimaryFlag==true)].PeriodOfServiceId

Case 2: If concurrent workRelationships is active and you want to fetch the attribute from Secondary workRelationships such as PeriodOfServiceId, then the JSON path for attribute mapping is:

workRelationships[?(@.PrimaryFlag==False)].PeriodOfServiceId

Case 3: If Multiple workRelationships is active.

API response for Multiple workRelationships looks like as follows:

"workRelationships": [

{

"PeriodOfServiceId": 300000034528102,

"LegislationCode": "IN",

"WorkerType": "E",

"PrimaryFlag": true,

"StartDate": "2022-08-11",

"assignments": [

{"AssignmentId": 300000034528108,

"AssignmentType": "E",

"PrimaryFlag": true,

"PrimaryAssignmentFlag": true,

… }

]

},

"PeriodOfServiceId": 300000034528226,

"LegislationCode": "IN",

"WorkerType": "N",

"PrimaryFlag": false,

"StartDate": "2022-08-23",

"assignments": [

{"AssignmentId": 300000034528233,

"AssignmentType": "P",

"PrimaryFlag": false,

"PrimaryAssignmentFlag": true,

… }

]

Suppose you want to fetch the attribute from assignments which is Primary and belongs to particular AssignmentType such as AssignmentId, then the JSON path for attribute mapping is:

workRelationships..assignments[?(@.PrimaryAssignmentFlag==true && @.AssignmentType=='E' && @.PrimaryFlag==true)].AssignmentId

Case 4: If you want to fetch the attribute from externalIdentifier of particular Type.

API response for externalIdentifiers looks like as follows:

"externalIdentifiers": [

{

"ExternalIdentifierId": 300000022800284,

"ExternalIdentifierSequence": 1,

"ExternalIdentifierNumber": "A",

"ExternalIdentifierType": "ORA_3RD_PARTY_PAY_ADD_ID",

….

}

]

Then the JSON pathfor attribute mapping is:

externalIdentifiers[?(@.ExternalIdentifierType=='ORA_3RD_PARTY_PAY_ADD_ID')].ExternalIdentifierId

Note

If you cannot fetch the values you are interested in for out-of-the-box attributes, follow the following steps for that attribute:

  1. Remove the existing out-of-the-box attribute (which is not fetching the required value) from Account Schema.

  2. Ensure that particular attribute is named differently from existing out-of-the-box attribute name.

  3. Add the new named attribute in the Account Schema.

  4. Mention appropriate JSON path query in the JSON Attribute Mapping for the new named attribute.

  5. Ensure that new named and conditioned attribute are also mentioned in the Workers API Additional Fields. Refer to Workers API Improved Aggregation to add additional attribute in the Workers API Additional Fields.