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

CreateAccountJSON Variable vs Literal - unexpected results

BrandonLucas_BF
Regular Contributor III
Regular Contributor III

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?

 

{
    "accountIdPath": "Entitlement.message.id",
    "responseColsToPropsMap": {
    "name": "Entitlement.message.userName~#~char",
    "displayName": "Entitlement.message.displayName~#~char"},
      "call": [
        {
          "name": "Entitlement",
          "connection": "acctAuth",
          "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}@DOMAINREMOVED\",\"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
            ]
          }
        }
      ]
    }
 
 
BrandonLucas_BF_0-1692655038915.png

 

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.]

4 REPLIES 4

rushikeshvartak
All-Star
All-Star

user.systemusername


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

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?

${user.systemUserName} should work https://docs.saviyntcloud.com/bundle/Coupa-v23x/page/Content/Understanding-the-Integration-between-E... 

${user.departmentname}

https://docs.saviyntcloud.com/bundle/PingOne-Guide/page/Content/Understanding-Integration-between-EI...


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

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!