Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
I'm trying to parse a tRest get request and it returns something that looks like this.
{
"id": "Ze1eyz4O2RKKwjfVU9IslMKVuaB",
"created_at": "2023-04-28T21:17:55.995Z",
"updated_at": "2023-04-28T21:18:02.872Z",
"amount_money": {
"amount": 9005,
"currency": "USD"
},
"status": "COMPLETED",
"source_type": "CARD",
"card_details": {
"status": "CAPTURED",
"card": {
"card_brand": "MASTERCARD",
"last_4": "8484",
"exp_month": 5,
"exp_year": 2027,
"cardholder_name": "CARD/SALARY",
"fingerprint": "sq-1-R1wu5iHpoepvv_tHggFA3XkevVAZ0x4w8zWuetP9s3DOFXH3XZJEH1YNu8MbzgZrtg",
"card_type": "DEBIT",
"prepaid_type": "PREPAID",
"bin": "542409"
},
"entry_method": "EMV",
"cvv_status": "CVV_NOT_CHECKED",
"avs_status": "AVS_NOT_CHECKED",
"auth_result_code": "028282",
"application_identifier": "A0000000041010",
"application_name": "Mastercard Debit",
"application_cryptogram": "d33f4ba805c53605",
"verification_method": "SIGNATURE",
"verification_results": "UNKNOWN",
"statement_description": "SQ *HNL - HONOLULU INTER",
"device_details": {
"device_id": "146CS134A2000309",
"device_name": "",
"device_installation_id": "59a3c452-5075-4307-b600-12b98ec1473c"
},
"card_payment_timeline": {
"authorized_at": "2023-04-28T21:17:56.466Z",
"captured_at": "2023-04-28T21:18:01.025Z"
}
},
"location_id": "27NA2Q0DDW471",
"order_id": "4w2Rgh4CyjXoufLmVI0KnzyeV",
"processing_fee": [
{
"effective_at": "2023-04-28T23:18:01.000Z",
"type": "INITIAL",
"amount_money": {
"amount": 244,
"currency": "USD"
}
}
],
Caused by: org.xml.sax.SAXParseException; lineNumber: 1; columnNumber: 37063; An invalid XML character (Unicode: 0x4) was found in the element content of the document.
And in the fingerprint elemet, I see the 0x4, and I'm trying to remove it with a replace or replaceAll.
I've tried the following with no lock, any help would be appricated.
output_row.Body = input_row.Body.replace("0x4","");
output_row.Body = input_row.Body.replace("(0x4)","");
output_row.Body = input_row.Body.replace("\\u0004,"");
Hello @Robert Veitch ,
To fix the issue, Please setup the Read By to "JsonPath" and setup related Json query for the related column for tExtractJSONFields component as the below