PARTNERS - Please join us for our upcoming webinar:
Leveraging Intelligent Recommendations for Operational Transformation.
AMS Partners click HERE | EMEA/APJ Partners click HERE

How to Escape these [',-,(,),_,] Characters in Rest Connection Json

AravindR
New Contributor
New Contributor
Hi,

I am trying to escape these characters [', -, (, ), _,] for attribute data in my connection JSON. The methodorg.apache.commons.lang.StringEscapeUtils.escapeJava() is working fine for other attributes in my create account JSON, but it is not working for the email attribute. Below is my created account JSON. If anyone could help me with this, I would appreciate it.

{
"accountIdPath": "accountName",
"responseColsToPropsMap": {},
"call": [
{
"name": "call1",
"connection": "acctAuth",
"url": "URL/SaviyntApp/PS/executepsscript",
"httpMethod": "POST",
"httpParams": "{\"Script\":\"C:/SaviyntPSScript/UserManagement.ps1 -OperationType 'CreateAccount' -Passwd '${connection.password}' -Username '${connection.username}' -Server 'ServerName' -Attributes \\\"UserName\\\",\\\"DisplayName\\\",\\\"FirstName\\\",\\\"LastName\\\",\\\"Initials\\\",\\\"Domain\\\",\\\"Department\\\",\\\"Company\\\",\\\"Title\\\",\\\"EmployeeID\\\",\\\"StreetAddress\\\",\\\"City\\\",\\\"State\\\",\\\"Zip\\\",\\\"Mobile\\\",\\\"BusinessPhone\\\",\\\"Fax\\\",\\\"Pager\\\",\\\"Office\\\" -AttributeValues \\\"${user.customproperty2}\\\",\\\"${user.displayname==null? '': org.apache.commons.lang.StringEscapeUtils.escapeJava(user.displayname)}\\\",\\\"${(user.preferedFirstName==null||user.preferedFirstName=='')?org.apache.commons.lang.StringEscapeUtils.escapeJava(user.firstname):org.apache.commons.lang.StringEscapeUtils.escapeJava(user.preferedFirstName)}\\\",\\\"${user.lastname==null?'':org.apache.commons.lang.StringEscapeUtils.escapeJava(user.lastname)}\\\",\\\"${user.middlename==null? '': org.apache.commons.lang.StringEscapeUtils.escapeJava(user.middlename)}\\\",\\\"${user.customproperty5==null? '': user.customproperty5}\\\",\\\"${user.departmentname==null? '': user.departmentname}\\\",\\\"${user.entity==null? '': user.entity}\\\",\\\"${user.title==null? '': user.title}\\\",\\\"${user.employeeid==null? '': user.employeeid}\\\",\\\"${user.customproperty22==null? '': user.customproperty22}\\\",\\\"${user.city==null? '': user.city}\\\",\\\"${user.state==null? '': user.state}\\\",\\\"${user.locationnumber==null? '': user.locationnumber}\\\",\\\"${user.customproperty24==null? '': user.customproperty24}\\\",\\\"${user.customproperty26==null? '': user.customproperty26}\\\",\\\"${user.customproperty23==null? '': user.customproperty23}\\\",\\\"${user.customproperty25==null? '': user.customproperty25}\\\",\\\"${user.entity==null? '': user.entity}\\\" -MandatoryAttributes \\\"UserName\\\",\\\"Domain\\\",\\\"DisplayName\\\" -Email ${user.email==null? '': org.apache.commons.lang.StringEscapeUtils.escapeJava(user.email)} \"}",
"httpHeaders": {
"Authorization": "${access_token}"
},
"httpContentType": "application/JSON",
"successResponses": {
"response[0].response": "Success"
}
}
]
}
Thanks,
Aravind

2 REPLIES 2

rushikeshvartak
All-Star
All-Star

Could you kindly provide a detailed snapshot of the information extracted from the logs, encompassing errors and other pertinent functionality details encountered during the execution of this process? Your assistance in furnishing this information would greatly aid in the analysis and resolution of any issues .



‼️‼️⚠️Do not upload any attachments that contain sensitive information, such as IP Addresses, URLs, Company/Employee Names, Email Addresses, etc.⚠️‼️‼️


Regards,
Rushikesh Vartak
If this helped you move forward, click 'Kudos'. If it solved your query, select 'Accept As Solution'.

AravindR
New Contributor
New Contributor

Thank you for the response.

For the email attribute in the Create Account JSON below, one is working fine. 
-Email "${user.email==null? '': (org.apache.commons.lang.StringEscapeUtils.escapeJava(user.email))}"