5

I am trying to log my hashmap it looks something like this : enter image description here

How do I convert it into proper json format ?

iron_man
  • 523
  • 3
  • 13

2 Answers2

4

Just add a transform message at the end of flow with

%dw2.0
application/json
---
payload
maddestroyer7
  • 233
  • 1
  • 5
2

You can use the Transform Component and write the dataweave code as follows:

%dw 2.0
output application/json
---
payload pluck(message,property,index) -> {(index) :{(property) :message}}

This should work.

HMT
  • 2,093
  • 1
  • 19
  • 51