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 having Multiple Contracts in SuccessFactor

Vipul
New Contributor II
New Contributor II
Hi Team, We are trying to implement a use case where if the user has multiple contracts in Successfactor, then only the primary contract of the user should be updated in Saviynt.
 
We have two successfactor connections (SF1 and SF2), where SF1 is responsible for creating users in Saviynt while SF2 is used for updating the attributes of the users. SF1 imports the data from the EmpEmployment table, while SF2 imports the data from the EmpJob table.
 
Example:
We have User Michale, who has 3 contracts or assignments in SuccessFactor:
When we trigger the import for this user:
SF1 imports the user, and whichever contract is picked up first, irrespective of whether it is primary or not, Saviynt uses that information to create the new user in Saviynt. Later, when the SF2 is triggered, it updates the user record with the contract details that come first in the API's response.
The issue is that we want the user record to be updated with the primary contract only. To check which contract is primary, we have another table in Successfactor, which is secondaryAssignment, which stores all the secondary contract details. 
 
So to get the primary contract, we have to do something like this: All contracts subtract contracts that we get from secondaryAssigment table.
 
Is it possible to achieve this using the REST API or something like this? Has anyone ever faced a similar issue before?
 
 
Below is the API response: The user (25300587) has 3 contracts: 25300587, 25300589 and 25300593, where the primary contract is 25300593, and the details of this contract should be updated at the user level in Saviynt.
 
SF1 Response:
 
{
    "d": {
        "results": [
            {
                "__metadata": {
                    "uri": "....",
                    "type": "...."
                },
                "personIdExternal": "25300587",
                "userId": "25300587"
.
.
.
.
            },
            {
                "__metadata": {
                    "uri": "....",
                    "type": "...."
                },
                "personIdExternal": "25300587",
                "userId": "25300589"
.
.
.
.
            },
            {
                "__metadata": {
                    "uri": "....",
                    "type": "...."
                },
                "personIdExternal": "25300587",
                "userId": "25300593"
.
.
.
.
.
.
            }
        ]
    }
}
 
 
 
 
SF2 API Response:
{
    "d": {
        "results": [
            {
                "__metadata": {
                    "uri": "....,
                    "type": "...."
                },
                "userId": "25300587",
                "startDate": "...."
                
            },
            {
                "__metadata": {
                    "uri": "....",
                    "type": "...."
                },
                "userId": "25300589",
                "startDate": "...."
               
            },
            {
                "__metadata": {
                    "uri": "....",
                    "type": "...."
                },
                "userId": "25300593",
                "startDate": "....."
                
            }
        ]
    }
}
 
 
 
 
SecondaryAssigment:
 
{
    "d": {
        "results": [
            {
                "__metadata": {
                    "uri": ".....",
                    "type": "....."
                },
                "allSfProcesses": {
                    "results": [
                        {
                            "__metadata": {
                                "uri": "....",
                                "type": "...."
                            },
                            "usersSysId": "25300587"
                        },
                        {
                            "__metadata": {
                                "uri": ".....",
                                "type": "...."
                            },
                            "usersSysId": "25300589"
                        }
                    ]
                }
            }
        ]
    }
}

I have removed the extra data from the API respone.

6 REPLIES 6

NM
Honored Contributor II
Honored Contributor II

Hi @Vipul , do you want to store the primary account value or can you elaborate more on the use of primary contract?

 

Vipul
New Contributor II
New Contributor II

Hi,

With every contract, we will get certain other details as well, such as department, company ID,start date, etc. So once we have identified which contract is primary, we will use the associated details to update the user attribute in Saviynt.

The below API response has 3 contracts, and every contract has other values associated with them:
1st contract (userId=25300587)
2nd contract  (userId=25300589)
3rd contract  (userId=25300593)

 

{
"d": {
"results": [
{
"__metadata": {
"uri": "....",
"type": "SFOData.EmpEmployment"
},
"personIdExternal": "25300587",
"userId": "25300587",
"endDate": null,
"lastDateWorked": null,
"startDate": "/Date(1716249600000)/",
"jobInfoNav": {
"results": [
{
"__metadata": {
"uri": "....",
"type": "SFOData.EmpJob"
},
"seqNumber": "1",
"userId": "25300587",
"startDate": "/Date(1716249600000)/",
"businessUnit": "GHCD01",
"company": "GB101",
"managerId": "15000147",
"departmentNav": {
"__metadata": {
"uri": "....",
"type": "SFOData.FODepartment"
},
"externalCode": "GB638",
"name": "Advisory & Restructuring"
}
}
]
}
},
{
"__metadata": {
"uri": "....",
"type": "SFOData.EmpEmployment"
},
"personIdExternal": "25300587",
"userId": "25300589",
"endDate": null,
"lastDateWorked": null,
"startDate": "/Date(1716249600000)/",
"jobInfoNav": {
"results": [
{
"__metadata": {
"uri": "....",
"type": "SFOData.EmpJob"
},
"seqNumber": "1",
"userId": "25300589",
"startDate": "/Date(1716249600000)/",
"businessUnit": "GHCF01",
"company": "GB109",
"managerId": "15003416",
"departmentNav": {
"__metadata": {
"uri": "...",
"type": "SFOData.FODepartment"
},
"externalCode": "GB666",
"name": "Restructuring"
}
}
]
}
},
{
"__metadata": {
"uri": "...",
"type": "SFOData.EmpEmployment"
},
"personIdExternal": "25300587",
"userId": "25300593",
"endDate": null,
"lastDateWorked": null,
"startDate": "/Date(1716249600000)/",
"jobInfoNav": {
"results": [
{
"__metadata": {
"uri": "...",
"type": "SFOData.EmpJob"
},
"seqNumber": "1",
"userId": "25300593",
"startDate": "/Date(1716249600000)/",
"businessUnit": "GHCD21",
"company": "GB102",
"managerId": "15004552",
"departmentNav": {
"__metadata": {
"uri": "....",
"type": "SFOData.FODepartment"
},
"externalCode": "GB938",
"name": "Advisory"
}
}
]
}
}
]
}
}

You need to have some flag to identify primary 


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

We have a table (SecondaryAssignment), which gives us all the secondary contracts of the users. 
So to determine the primary contract, we can subtract the contracts that we get from the SecondaryAssignment table from all the contracts that we get from the SF1 API call. But I am not sure how to do it in JSON or if there is any other way of doing it.

Right now, there is no other way of determining the primary contracts apart from referring to the secondary assignment table.

You may try using custom extension and implement this logic 


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

Is there any other way of implementing it without using a custom extension? 

Anyone who has integrated the success factor with Saviynt must have faced a similar issue.