Click HERE to see how Saviynt Intelligence is transforming the industry. |
09/10/2024 09:30 AM
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
09/10/2024 09:53 AM - edited 09/10/2024 09:55 AM
@pahm
"${requestAttributes.get('dept').replace('&', '&')}"
09/10/2024 10:05 AM
StringEscapeUtils.unescapeXml(${requestAttributes.get('dept')})
09/10/2024 10:19 AM
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,
09/10/2024 10:20 AM
Yes it will work
"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\"}",
09/10/2024 10:18 AM
org.apache.commons.lang.StringEscapeUtils.escapeJava(${requestAttributes.get('dept')})