Saviynt unveils its cutting-edge Intelligence Suite products to revolutionize Identity Security!
Click HERE to see how Saviynt Intelligence is transforming the industry.
Saviynt Copilot Icon

How to handle special characters of account attribute in REST Connector Provisioning JSON settings?

pahm
New Contributor III
New Contributor III

Hello

We configured REST Connector and setup the JSON setting for CreateAccountJSON and UpdateAccountJSON which take values from dynamic attribute forms and the dynamic attribute value come from Saivynt Single SQL select from entitlementvalue table or accounts table.

Everything works fine until it process the attribute value which contains special characters &. it was converted to & as XML escape character. However, the target system will not accept this converted value. How should I do for the data conversion in attribute mapping JSON setting?

For example, I have a attribute mapping as below:

\"target_attr_name\" : \"${requestAttributes.get('dept')}\",

When detp value is "Research & Development", it will trigger the issue. how can we control to make & not converted to & ?

Thanks

 

5 REPLIES 5

stalluri
Valued Contributor II
Valued Contributor II

@pahm 
"${requestAttributes.get('dept').replace('&', '&')}"


Best Regards,
Sam Talluri
If you find this a helpful response, kindly consider selecting Accept As Solution and clicking on the kudos button.

rushikeshvartak
All-Star
All-Star

StringEscapeUtils.unescapeXml(${requestAttributes.get('dept')})


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

pahm
New Contributor III
New Contributor III

Thanks guys, I'll try it out. what if the 'dept' attribute on form is Multi SQL Select? so it will have 3 situations, no value selected, one value selected, and two or more values selected. does the code works for all 3 situations?

Thanks,

Yes it will work

Refer https://forums.saviynt.com/t5/saviynt-knowledge-base/json-handling-escape-characters-in-rest-connect...

        "httpParams": "{\"u_emplid\":\"${user.username}\", \"u_vendor_name\":\"Sayvint\", \"u_assignment_group\":\"MSP L2 Essbase\", \"u_short_descr\":\"Snow Access - ${user.username}\", \"u_description\":\"${org.apache.commons.lang.StringEscapeUtils.escapeJava(reqAttrs.customproperty10)}\", \"u_vendor_case_number\":\"7\", \"u_config_item\":\"Essbase\", \"u_priority\":\"3-Medium\", \"u_comments\":\"abcd\", \"u_work_notes\":\"Saviynt\"}",


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

Raghu
All-Star
All-Star

@pahm 

org.apache.commons.lang.StringEscapeUtils.escapeJava(${requestAttributes.get('dept')})


Thanks,
Raghu
If this reply answered your question, Please Accept As Solution and hit Kudos.