Announcing the SAVIYNT KNOWLEDGE EXCHANGE unifying the Saviynt forums, documentation, training, and more in a single search tool across platforms. Click HERE to read the Announcement.

REST - ImportUserJSON - MultiCall for 3 Calls

vermilyacd1
Regular Contributor
Regular Contributor

Good morning team! Looking to add a 3rd call into the MultiCall option for a REST based connection but the ${userIdentifier} variable is not populated in the third call (works great in the second call). I tried saving it into a custom variable in the second call to then reference in the third call but no dice.

Any Advice?

This is v2021.

9 REPLIES 9

rushikeshvartak
All-Star
All-Star

Can you share JSON


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

vermilyacd1
Regular Contributor
Regular Contributor

Sure thing, URLs redacted but queryString params left intact.

{
"type": "multiCall",
"call": [
{
"name": "SFCall1",
"connection": "SFAuth",
"url": "https://<redacted>/odata/v2/User?%24filter=userId%20eq%2012001309%20or%20userId%20eq%2012001310",
"httpMethod": "GET",
"httpHeaders": {
"Content-Type": "application/json",
"Authorization": "${access_token}",
"Accept": "application/json"
},
"colsToPropsMap": {
"username": "userId~#~char",
"systemUserName": "empId~#~char",
"firstName": "firstName~#~char",
"preferedFirstName": "nickname~#~char",
"middlename": "mi~#~char",
"lastName": "lastName~#~char",
"employeeid": "empId~#~char",
"employeeType": "custom04~#~char",
"phonenumber": "businessPhone~#~char",
"street": "",
"city": "city~#~char",
"state": "state~#~char",
"country": "country~#~char",
"companyname": "",
"customproperty1": "userId~#~char",
"customproperty2": "empId~#~char",
"customproperty3": "custom04~#~char",
"customproperty4": "firstName~#~char",
"customproperty5": "nickname~#~char",
"customproperty6": "mi~#~char",
"customproperty7": "lastName~#~char",
"customproperty8": "email~#~char",
"customproperty9": "city~#~char",
"customproperty10": "state~#~char",
"customproperty11": "country~#~char",
"customproperty13": "custom07~#~char",
"customproperty14": "department~#~char",
"customproperty15": "jobcode~#~char",
"customproperty16": "location~#~char",
"customproperty18": "businessPhone~#~char",
"customproperty23": "status~#~char"
},
"userResponsePath": "d.results"
},
{
"name": "SFCall2",
"connection": "SFAuth",
"url": "https://<redacted>/odata/v2/EmpJob?%24filter=userId%20eq%20${userIdentifier}",
"httpMethod": "GET",
"httpHeaders": {
"Content-Type": "application/json",
"Authorization": "${access_token}",
"Accept": "application/json"
},
"colsToPropsMap": {
"username": "userId~#~char",
"manager": "managerId~#~char",
"costcenter": "costCenter~#~char",
"customproperty12": "countryOfCompany~#~char",
"customproperty17": "managerId~#~char",
"customproperty25": "costCenter~#~char",
"customproperty26": "contractEndDate~#~epochdate",
"customproperty27": "customString102~#~char"
},
"userResponsePath": "d.results"
},
{
"name": "SFCall3",
"connection": "SFAuth",
"url": "https://<redacted>/odata/v2/EmpEmployment?%24filter=userId%20eq%20${userIdentifier}",
"httpMethod": "GET",
"httpHeaders": {
"Content-Type": "application/json",
"Authorization": "${access_token}",
"Accept": "application/json"
},
"colsToPropsMap": {
"username": "userId~#~char",
"customproperty19": "originalStartDate~#~epochdate",
"customproperty20": "startDate~#~epochdate",
"customproperty21": "endDate~#~epochdate",
"customproperty22": "lastDateWorked~#~epochdate"
},
"userResponsePath": "d.results"
}
]
}

from where ${userIdentifier} is get populated?

check if below is useful. 

 

https://saviynt.freshdesk.com/support/solutions/articles/43000616093-declaring-passwords-or-user-def... 

 

https://forums.saviynt.com/t5/general-discussions/how-to-make-multiple-api-calls-on-import-user-json... 


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

AshishDas
Regular Contributor II
Regular Contributor II

Hi Rushi,

The MultiCall in UserImportJson is executing only the first call. It does not execute the second call.

Any inputs?

vermilyacd1
Regular Contributor
Regular Contributor

Thanks @rushikeshvartak. ${userIdenifier} is populated automatically by Saviynt as part of the multicall. I do not set it. I tried to set it using the approach in the article but the third call cannot see the variable.

I have looked at that community article but the recommended solution is not helpful in this case

What's value of userIdentifier? 

Try if you can set value in connection with another variable name & fetch in import json

Connection Json

UserIdentifierConn :"${userIdentifier}"

&

Import json

${connection.userIdentifierConn}


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

vermilyacd1
Regular Contributor
Regular Contributor

@rushikeshvartak , the value of ${userIdentifier} is dynamic. The way multicall works is the first call is run, and then each subsequent call is run for every user. The accountID value is mapped to ${userIdentifier} and then call2 is run. Call2 is run for every user and ${userIdentified} is updated for each call. You cannot set this value in the connectionJSON as it is dynamic.

vermilyacd1
Regular Contributor
Regular Contributor

For the time being, I have duplicated the connection and used another multicall in the UserImportJSON to pick up the data I need.

adriencosson
Regular Contributor III
Regular Contributor III

Hi @vermilyacd1,

If MultiCall option is not working with the ${userIdentifier} binding variable, have you tried using ${response.SFcall1.message.userId} to be called in the subsequent calls ?

Regards,
Adrien COSSON