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

SpiroTaleski
Valued Contributor

@manjunathsinghs 

Using File Writer Snap you can capture/store the incoming data in a file. 

Hi,

Thanks for reply.
Json Parser snap is the first snap in my pipeline and when the input request is valid and able to parse it and then i can able to capture it using Mapper snap (above screenshot for ref.).
But, if the input request is not valid and failed at parser snap. then i donno how to capture that input data.
So, Not sure how File Writer snap can help to capture the input request from parser snap? Can you please explain where i should use it in the flow.
Thanks.

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.

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