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

How to map create account json response to account attributes or user attributes

amitasingh
New Contributor
New Contributor

Hi Team,

For one of the business usecases, we triggered multiple APIs from CreateAccountJSON. The first API triggered the job to create the account on the target application, and the second API received the response, which we used to check the condition and map the response parameter to customproperty attributes of the account. The line where we are attempting to read the response is shown below.

"ResultValue": "${response.call2.message.OutputArguments.UserReconOut.Result}"

and in below body we are trying to map that value

"responseColsToPropsMap": {
"comments": "response.call2.message.OutputArguments.UserReconOut.Result.login~#~char"
}

Below is the whole JSON body of connection and createaccoutnjson 

Connection Body===============

{
"authentications": {
"acctAuth": {
"authType": "oauth2",
"url": "https://account.uipath.com/oauth/token",
"httpMethod": "POST",
"httpParams": {
"grant_type": "refresh_token",
"client_id": "xxxxxx",
"refresh_token": "xxxxxx"
},
"httpHeaders": {
"Content-Type": "application/json",
"X-UIPATH-TenantName": "DefaultTenant"
},
"httpContentType": "application/json",
"expiryError": "ExpiredAuthenticationToken",
"authError": [
"USER_AUTHENTICATION_FAILED",
"PARTNER_AUTHENTICATION_FAILED",
"AuthenticationFailed"
],
"timeOutError": "Read timed out",
"errorPath": "errorCode",
"maxRefreshTryCount": 5,
"tokenResponsePath": "result",
"tokenType": "Bearer",
"retryFailureStatusCode": [
401
],
"accessToken": "Bearer xxxxxx"
}
}
}

================================================

CreateAccountJSON====================================

{
"accountIdPath": "call1.message.id",
"dateFormat": "yyyy-MM-dd'T'HH:mm:ssXXX",
"responseColsToPropsMap": {
"name": "call1.message.name~#~char",
"displayName": "call1.message.name~#~char",
"updatedate": "call1.message.modified_at~#~date",
"comments": "call1.message.login~#~char",
"comments": "response.call2.message.OutputArguments.UserReconOut.Result.login~#~char"
},
 
"call": [{
"name": "call1",
"connection": "acctAuth",
"showResponse": false,
"httpMethod": "POST",
"httpParams": "{\"startInfo\": {\"Strategy\": \"Specific\",\"ReleaseKey\": \"ccf82d87-9b8a-4a3e-b393-d17d2022381f\",\"RobotIds\":[1270531],\"InputArguments\":\"{\\\"Operation\\\":\\\"Create\\\"}\"}}",
"httpHeaders": {
"Authorization": "${access_token}",
"Content-Type": "application/json",
"X-UIPATH-OrganizationUnitId": "4429631",
"X-UIPATH-TenantName": "DefaultTenant"
},
"httpContentType": "application/json"
 
},
 
{
"name": "call2",
"connection": "acctAuth",
"showResponse": false,
"httpMethod": "GET",
"httpParams": "",
"httpHeaders": {
"Authorization": "${access_token}",
"Content-Type": "application/json",
"X-UIPATH-OrganizationUnitId": "4429631",
"X-UIPATH-TenantName": "DefaultTenant"
},
"httpContentType": "application/json",
"ResultValue": "${response.call2.message.OutputArguments.UserReconOut.Result}"
 
},
{
"successResponses": {
"if": {
"ResultValue": "success"
},
"then": {
"statusCode": [
200,
201
]
},
"else": {
"unsuccessResponses": {
"response.StatusCode": "1"
}
}
}
}
 
]
 
}
 
The issue is that the response is successful, but the response value is not mapped to any attribute, and we also want to know how to use an if-else condition to validate the response values.
 
[This post has been edited by a Moderator to remove sensitive information.]
2 REPLIES 2

SB
Saviynt Employee
Saviynt Employee

Are you trying to store call2 response value under comments attribute? If so, you can use the format as below. Please ensure the response path is correct for the value you are trying to retrieve and should be defined under responseColsToPropsMap section.

"comments": "call2.message.path_of_field~#~char"


Regards,
Sahil

rushikeshvartak
All-Star
All-Star

Sample

{
"accountIdPath": "call1.message.id",
"responseColsToPropsMap": {
"displayName": "call1.message.fullname~#~char",
"name": "call1.message.login~#~char",
"customproperty1": "call1.message.email~#~char",
"customproperty2": "call1.message.firstname~#~char",
"customproperty3": "call1.message.lastName~#~char",
"customproperty4": "call1.message.fullname~#~char",
"customproperty5": "call1.message.mention-name~#~char",
"customproperty6": "call1.message.company~#~char",
"customproperty7": "call1.message.cost-center~#~char",
"customproperty8": "call1.message.purchasing-user~#~char",
"customproperty9": "call1.message.expense-user~#~char",
"customproperty10": "call1.message.sourcing-user~#~char",
"customproperty11": "call1.message.inventory-user~#~char",
"customproperty12": "call1.message.contracts-user~#~char",
"customproperty13": "call1.message.analytics-user~#~char",
"customproperty14": "call1.message.created-by.id~#~char" },
"call": [
{
"name": "call1",
"connection": "acctAuth",
"url": "https://<BASE_URL>/api/users/",
"httpMethod": "POST",
"httpParams": "{\"login\":\"${user.username}\",\"active\":true,\"email\":\"${user.systemUserName}@domain.com\",\"firstname\":\"${user.firstname}\",\"lastname\":\"${user.lastname}\",\"fullname\":\"${user.firstname} ${user.lastname}\",\"company\":\"IN10\",\"cost-center\":\"IN1019624\",\"purchasing-user\":\"${requestAccessAttributes.customproperty8}\",\"expense-user\":\"${requestAccessAttributes.customproperty9}\",\"sourcing-user\":\"${requestAccessAttributes.customproperty10}\",\"inventory-user\":\"${requestAccessAttributes.customproperty11}\",\"contracts-user\":\"${requestAccessAttributes.customproperty12}\",\"analytics-user\":\"${requestAccessAttributes.customproperty13}\"}",
"httpHeaders": {
"X-COUPA-API-KEY": "${access_token}",
"Accept": "application/json" },
"httpContentType": "application/json",
"successResponses": {
"statusCode": [
201
]
}
}
]
}

https://docs.saviyntcloud.com/bundle/Coupa-v2022x/page/Content/Understanding-the-Integration-between...


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