Escape characters are appearing after extracting JSON data by using ExtractVariables policy

Not applicable

Extract Variable policy is being used for extracting part of the backend response.

Partial ExtractVariables policy:

<JSONPayload> 
	<Variable name="data">
  		<JSONPath>$.data</JSONPath>
 	</Variable> 
</JSONPayload> 

After extraction, Part of the extracted response has escape characters:

"nextDataSet":"https:\/\/www.apigee.com\/application\/lob\/v1\/notification\/resource?lastRecord=N-xxx"
How these escape characters can be avoided / removed from response?
Solved Solved
0 1 830
1 ACCEPTED SOLUTION

Not applicable

A simple JavaScript can be applied to remove these addiitonal escape characters:

var data=JSON.stringify(JSON.parse(context.getVariable("data")));

context.setVariable("response.content",data);

View solution in original post

1 REPLY 1

Not applicable

A simple JavaScript can be applied to remove these addiitonal escape characters:

var data=JSON.stringify(JSON.parse(context.getVariable("data")));

context.setVariable("response.content",data);