Announcing the Saviynt Knowledge Exchange unifying the Saviynt forums, documentation, training,
and more in a single search tool across platforms. Read the announcement here.

Combining user date from two REST calls

Sampsa
New Contributor II
New Contributor II

Hi,

Is it possible to combine user date from two sources in the REST connector ImportUserJSON?

We would like to do a user import using the REST connector using two api calls so that we would get one set of users from the first call and then more users from another call. If the second call includes user with the same employeeID it would overwrite that user from the first call.

Is this possible to achieve?

Br,

Sampsa

6 REPLIES 6

KrishnaGupta
New Contributor III
New Contributor III

Hi Sampsa,

It is possible to have multiple calls in ImportUserJSON of REST connector.
Both calls can create users i.e. one set of users from the first call and then more users from another call.
Also if same user is part of both the calls then it combines data for the user from both calls provided the we are getting the user reconciliation field in both calls.
I have implemented both these scenarios separately but not together.
Can you share more details about your use case? 


Regards,
Krishna Gupta
If you find the response useful, kindly consider selecting Accept As Solution and clicking on the kudos button.

Sampsa
New Contributor II
New Contributor II

Hi KrishnaGupta,

We are setting up an import from Workday using a REST connector. The problem is that there are two API's to use. One will return the current users and the other will return future dated users. It is possible that some users will be present in both datasets and in that case we would like only to import the record coming from the future dated api.

Is it possible for you to share an example of this kind of configuration?

Br,

Sampsa

NM
Valued Contributor
Valued Contributor

Hi @Sampsa , what is the unique/reconciliation field you are using? Does that get populated for future dated user?

KrishnaGupta
New Contributor III
New Contributor III

Hi Sampsa,

I understand the use case now, you can try with the following format if user recon field is available in both API's. The sequence of API calls will depend on the precedence, in your case second call will be to the future dated API

 

{ 
	"type": "multiCall", 
	"call": [ 
		{ 
			"name": "call1", 
			"connection": "UserAuth", 
			"url": "<URL>", 
			"httpMethod": "GET", 
			"httpHeaders": { 
				"Authorization": "${access_token}" 
			}, 
			"httpContentType": "application/json", 
			"userResponsePath": "<PATH>", 
			"keyField": "_fields.Employee", 
			"colsToPropsMap": { 
				"employeeid": "_fields.EmployeeID~#~char", 
				"username": "_fields.Username~#~char", 
				"firstname": "_fields.Firstname~#~char" 
			} 
		}, 
		{ 
			"name": "call2", 
			"connection": "UserAuth", 
			"url": "<URL>", 
			"httpMethod": "GET", 
			"httpHeaders": { 
				"Authorization": "${access_token}" 
			}, 
			"userResponsePath": "<PATH>", 
			"keyField": "_fields.EmployeeID", 
			"colsToPropsMap": {
				"employeeid": "_fields.EmployeeID~#~char", 
				"username": "_fields.Username~#~char", 
				"firstname": "_fields.Firstname~#~char" 
			} 
		} 
	] 
}

 


Alternatively you can also consider requesting the workday team to send users in only one of the report this will reduce the complication significantly if you are doing any calculation or manipulation for user lifecycle events.

For example the user is a rehire, user is part of the current file as a terminated user and in the future file you will get the user as a rehire. In this case workday team should not send the user as part of the current file and the user should only be part of the future report as a rehire.



Regards,
Krishna Gupta
If you find the response useful, kindly consider selecting Accept As Solution and clicking on the kudos button.

rushikeshvartak
All-Star
All-Star

Yes its possible also you can use callCondition 

{
  "type": "multiCall",
  "call": [
    {
      "name": "call1",
      "connection": "acctAuth",
      "url": "https://<url>/api/v2/users.json",
      "httpMethod": "GET",
      "httpHeaders": {
        "Content-Type": "application/json",
        "Authorization": "${access_token}"
      },
      "colsToPropsMap": {
        "username": "id~#~char",
        "customproperty1": "email~#~char"
      },
      "userResponsePath": "users"
    },
    {
      "name": "call2",
      "connection": "acctAuth",
      "callCondition": "${response.call1.message.users.size()>0}",

      "url": "https://<url>/api/v2/users/${userIdentifier}.json",
      "httpMethod": "GET",
      "httpHeaders": {
        "Authorization": "${access_token}"
      },
      "colsToPropsMap": {
        "username": "user.id~#~char",
        "customproperty45": "user.email~#~char"
      },
      "userResponsePath": ""
    }
  ]
}

Regards,
Rushikesh Vartak
If you find the response useful, kindly consider selecting Accept As Solution and clicking on the kudos button.

Sampsa
New Contributor II
New Contributor II

Hi @KrishnaGupta,

Thanks for the example. This works just like needed.

Br,

Sampsa