Click HERE to see how Saviynt Intelligence is transforming the industry. |
08/21/2023 02:57 PM - last edited on 08/21/2023 03:50 PM by Dave
Can someone help me understand why this CreateAccountJSON (REST) is resulting in not recognizing the Saviynt variable for user.systemUsername and instead is treating it as a literal?
Have tried several variations including the following with the same result:
{
"accountIdPath": "Entitlement.message.id",
"responseColsToPropsMap": {
"name": "Entitlement.message.userName~#~char",
"displayName": "Entitlement.message.displayName~#~char"},
"call": [
{
"name": "Entitlement",
"connection": "acctAuth",
"url": "https://scim.zscalertwo.net/REMOVED/scim/Users",
"httpMethod": "POST",
"httpParams": "{\"userName\":\"REMOVED\",\"displayName\":\"${user.displayName}\",\"department\":\"${user.departmentName}\"}}",
"httpHeaders": {
"Authorization": "${access_token}",
"Accept": "application/json" },
"httpContentType": "application/json",
"successResponses": {
"statusCode": [
201
]
}
}
]
}
The variable gets passed in rather than the data.
[This post has been edited by a Moderator to merge two posts.]
Solved! Go to Solution.
08/21/2023 10:00 PM
user.systemusername
08/22/2023 08:52 AM - edited 08/22/2023 09:10 AM
That's what I was trying as well, with same unexpected result. Here is what I have found in testing.
{
"accountIdPath": "Entitlement.message.id",
"call": [
{
"name": "Entitlement",
"connection": "acctAuth",
"url": "https://scim.zscalertwo.net/REMOVED/scim/Users",
"httpMethod": "POST",
"httpParams": "{\"schemas\":[\"urn:ietf:params:scim:schemas:core:2.0:User\",\"urn:ietf:params:scim:schemas:extension:enterprise:2.0:User\"],\"userName\":\"${user.systemUserName}@domain.com\",\"displayName\":\"${user.displayname}\",\"urn:ietf:params:scim:schemas:extension:enterprise:2.0:User\" : {\"department\":\"Needs Update\"}}",
"httpHeaders": {
"Authorization": "${access_token}",
"Accept": "application/json" },
"httpContentType": "application/json",
"successResponses": {
"statusCode": [
201
]
}
}
]
}
If I use the above JSON for
If I use the above CreateAccountJSON, the account is created with all variable data passed in correctly. Noptice that the 'department' data is a static text value of "Needs Update". What is desired is that we would also pass in $(user.departmentname), so let's change the JSON:
{
"accountIdPath": "Entitlement.message.id",
"call": [
{
"name": "Entitlement",
"connection": "acctAuth",
"url": "https://scim.zscalertwo.net/38371388/292324/scim/Users",
"httpMethod": "POST",
"httpParams": "{\"schemas\":[\"urn:ietf:params:scim:schemas:core:2.0:User\",\"urn:ietf:params:scim:schemas:extension:enterprise:2.0:User\"],\"userName\":\"${user.systemUserName}@b-f.net\",\"displayName\":\"${user.displayname}\",\"urn:ietf:params:scim:schemas:extension:enterprise:2.0:User\" : {\"department\":\"${user.departmentname}\"}}",
"httpHeaders": {
"Authorization": "${access_token}",
"Accept": "application/json" },
"httpContentType": "application/json",
"successResponses": {
"statusCode": [
201
]
}
}
]
}
Using this JSON that includes ${user.departmentname}, it blows the whole thing up and instead of passing in variable data, it starts passing in the variable names as static text.
When I adjust the JSON to pass in ${user.displayname} for the department value, it works. Any ideas what could be wrong here?
08/22/2023 09:55 PM
${user.systemUserName} should work https://docs.saviyntcloud.com/bundle/Coupa-v23x/page/Content/Understanding-the-Integration-between-E...
${user.departmentname}
08/23/2023 05:56 AM - edited 08/23/2023 05:57 AM
It should work. After hours of trial and error, here is what I finally figured out.
This JSON "breaks" and causes the variable name instead of data to passed in for all variables:
{
"accountIdPath": "Entitlement.message.id",
"call": [
{
"name": "Entitlement",
"connection": "acctAuth",
"url": "https://scim.zscalertwo.net/REMOVED/scim/Users",
"httpMethod": "POST",
"httpParams": "{\"schemas\":[\"urn:ietf:params:scim:schemas:core:2.0:User\",\"urn:ietf:params:scim:schemas:extension:enterprise:2.0:User\"],\"userName\":\"${user.systemUserName}@DOMAIN.COM\",\"displayName\":\"${user.displayname}\",\"urn:ietf:params:scim:schemas:extension:enterprise:2.0:User\" : {\"department\":\"${user.departmentname}\"}}",
"httpHeaders": {
"Authorization": "${access_token}",
"Accept": "application/json" },
"httpContentType": "application/json",
"successResponses": {
"statusCode": [
201
]
}
}
]
}
This JSON works and all variable data is passed correctly:
{
"accountIdPath": "Entitlement.message.id",
"call": [
{
"name": "Entitlement",
"connection": "acctAuth",
"url": "https://scim.zscalertwo.net/REMOVED/scim/Users",
"httpMethod": "POST",
"httpParams": "{\"schemas\":[\"urn:ietf:params:scim:schemas:core:2.0:User\",\"urn:ietf:params:scim:schemas:extension:enterprise:2.0:User\"],\"userName\":\"${user.systemUserName}@DOMAIN.COM\",\"displayName\":\"${user.displayname}\",\"urn:ietf:params:scim:schemas:extension:enterprise:2.0:User\" : {\"department\":\"${if(user.departmentname != null){user.departmentname} else{''}}\"}}",
"httpHeaders": {
"Authorization": "${access_token}",
"Accept": "application/json" },
"httpContentType": "application/json",
"successResponses": {
"statusCode": [
201
]
}
}
]
}
Do you see the difference? Just a little bit of unnecessary javascript using the *same* Saviynt variable.. and this works.
{\"department\":\"${if(user.departmentname != null){user.departmentname} else{''}}\"}
Seems like a bug!