03/27/2023 11:54 PM
Hi Team,
We are using below ChangePassJSON in REST connector. When this json is called it is not able to evaluate the value for variable ${user?.username}
Error we are geting "User Does not exist". Please assist.
{
"accountIdPath": "call1.message.AccountID",
"call": [{
"name": "call1",
"connection": "acctAuth",
"url": "https://localhost.saviyntcloud.com/ECM/api/v5/changePassword",
"httpMethod": "POST",
"httpParams": "{\"username\":\"${user?.username}\",\"password\":\"${task?.password}\",\"changePasswordAssociatedAccounts\":\"true\",\"endpoint\":\"[Xstore]\",\"validateagainstpolicy\":\"N\"}",
"httpHeaders": {
"Content-Type": "application/json",
"Authorization": "${access_token}"
},
"httpContentType": "application/json",
"successResponses": {
"statusCode": [200, 201]
}
}]
}
Solved! Go to Solution.
03/28/2023 12:51 AM
${user.username} should work. But just to isolate the issue, if you try to pass the only user name as hardcoded value in the above json instead of expression does that work?
03/28/2023 12:58 AM
Yes, with hardcoded value in username it works fine.
I tried following variable but none of them works.
${user.username}
${users.username}
${user?.username}
${users?.username}
${username}
04/06/2023 11:49 AM
Hi @vermark, as @nimitdave mentioned ${user.username} is the correct syntax.
Can you try the below JSON to see if it resolves your issues? I noticed that you are using "${task?.password}" while we should be using "${password}" instead.
{
"call": [
{
"name": "call1",
"connection": "acctAuth",
"url": "https://localhost.saviyntcloud.com/ECM/api/v5/changePassword",
"httpMethod": "POST",
"httpParams": "{\"username\":\"${user.username}\",\"password\":\"${password}\",\"changePasswordAssociatedAccounts\":\"true\",\"endpoint\":\"[Xstore]\",\"validateagainstpolicy\":\"N\"}",
"httpHeaders": {
"Content-Type": "application/json",
"Authorization": "${access_token}"
},
"httpContentType": "application/json",
"successResponses": {
"statusCode": [
200,
201
]
}
}
]
}
If the issue still persists, I would recommend opening a support ticket via Freshdesk as it would require deeper triaging.
04/06/2023 10:29 PM
Hi Team,
Thanks for the update.
It worked with ${arsTasks.getPassword()}