on 12-05-2015 6:38 PM
Hi Experts,
In my HCI iFlow I'm using the XML to JSON Converter. It works fine for String values however for integer values it also puts quotes around the value. For example: {"Value":"20161212"}
However what I need is: {"Value":20161212} i.e. without the quotes around the integer value.
Is there anyway I can remove these quotes?
Thanks,
Krishneel
Dear all.
See below for double or float values:
String output = input.replaceAll("\"(\\d+\\.?\\d+?)\"", "\$1");
Regards.
Juan.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Krishneel
From the online help library below, it mentions that all XML elements/attributes are transformed to a JSON String. So I don't think you can configure the converter to handle integer values.
SAP HANA Cloud Integration (External)
An alternative would be to use a Groovy script after the converter to "clean" up those fields that are integer only. You can use the String class' replaceAll method to locate and replace those fields using Regex - sample usage below
String output = input.replaceAll("\"(\\d+)\"", "\$1");
Rgds
Eng Swee
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
87 | |
10 | |
10 | |
10 | |
7 | |
6 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.