Mike C2
Kilo Contributor

@Ankur Bawiskar 

 

Few questions. From what you shared earlier you created the "str" object with this data that included the outermost notation marks;

find_real_file.png

 

However, when I look at the Response Body in my Outbound HTTP Log that isn't there;

find_real_file.png

So, if I'm not mistaken when my "var response = request.execute();" completes then I'm left with this;

var response = {"import_set":"ISET4030016","staging_table":"u_test_request","result":[{"transform_map":"Test Transform","table":"sc_req_item","status":"error","error_message":"Target record not found","status_message":"Order Placed;Row transform ignored by onBefore script","test_sys_id":"3cc1848a07e2761445600e9137a4b0f8","test_display_value":"TEST0235522"}]}

 

Is that correct? If so I've already taken these steps to ADD the ' marks and it works in the Scripts-Background but still not working in the System Logs.

 

 

 

Before Stringify;

find_real_file.png

 

 

After Stringify;

find_real_file.png

 

 

 

When I try to stringify the results for my Business Rule though it still isn't working;

org.mozilla.javascript.EcmaError: Cannot read property "0" from undefined
Caused by error in sys_script.4203538d1b7e8c10da7b10e4bd4bcb74.script at line 32

29: var modifiedResponse = "'" + JSON.stringify(response) + "'";
30: var parser = new JSONParser();
31: var parsedResponse = parser.parse(modifiedResponse);
==> 32: gs.log(parsedResponse.result[0].test_sys_id);
33: gs.log(parsedResponse.result[0].test_display_value);