Forum Discussion
Hi Mohit!
What you might try is passing that JSON over to a mapper, and using the mapper to do what you want.
Turn off pass through in the mapper and use an expression language statement to convert everything to a string like this:
$.mapValues(x=>x == null ? "" : x.toString())
This will essentially set everything to a string, even an empty string.
Here’s what my mapper looks like to do this:
Hope that gets you closer!
– David
@djsiegel I am not using the pass through. I am just mapping the fields in mapper snap and then sending it to Json formatter snap to generate the Json but it is only showing single quotation mark for empty values.
I tried your expression as well but it is also not working.
Related Content
- 5 months ago
- 11 months ago
- 2 years ago
- 11 months ago