Click HERE to see how Saviynt Intelligence is transforming the industry. |
07/14/2023 09:33 AM - last edited on 07/17/2023 08:24 AM by Dave
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====================================
07/17/2023 09:05 AM
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"
07/17/2023 09:11 AM
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
]
}
}
]
}