cancel
Showing results for 
Search instead for 
Did you mean: 

How can i get the input data sent to JSON parser snap.

manjunathsinghs
New Contributor II

Hi, I have JSON parser snap in my pipeline and it is getting data from external resources.
Sometimes the data parse is failing due to invalid input. But am not able to capture that input data and error shows only "Invalid Json error" message (as below).

"error": "Cannot parse JSON data",
"reason": "Unable to parse JSON input, Invalid UTF - 8 middle byte 0x20"
manjunathsinghs_0-1706878515310.png
Can somebody help me, how to capture the input data getting into Json parser snap.

Thank You.

 

 
2 ACCEPTED SOLUTIONS

Aleksandar_A
Contributor III

Hello @manjunathsinghs,

I'd suggest using the Binary Copy Snap as your starting point. Then create two copy branches: one for storing the payload through the File Writer Snap, and the other for your downstream logic.

Try this and let me know if this helps you.

Regards,

Aleksandar.

View solution in original post

SpiroTaleski
Valued Contributor

@manjunathsinghs 

As @Aleksandar_A outlined, put Binary Copy Snap as a first pipeline snap: 

SpiroTaleski_0-1707126564043.png

Make sure that the both Routes are satisfied, so the data can flow in both outputs: 

SpiroTaleski_1-1707126769540.png

BR,

Spiro Taleski

View solution in original post

7 REPLIES 7

manjunathsinghs
New Contributor II

Thank You, @SpiroTaleski , @Aleksandar_A .
With your suggestion, am able to capture all the input data coming to my pipeline.
Is there any way i can capture only invalid input data, which fails at json parser?
Thanks.

SpiroTaleski
Valued Contributor

@manjunathsinghs 

The JSON parser snap will not keep/forward the incoming "invalid" data on a Snap Error view.  So, probably you will need to re-design the whole pipeline. 

Typically, this kind of issues should be resolved/handled on the source system that actually is sending the "invalid" data to SnapLogic endpoint.   

Okay Got It.
Thanks @SpiroTaleski .