Parsing and using the json response of a post in a subsequent post

Hi all,

I am stuck. I have a scenario where I receive a json response with an array of attributes. I need to transform the result and use it in another json post.

I have something like this in my session:

Session(payees → Vector([{“disabled”:false,“uid”:"314”, “foo”: "bar},{“disabled”:true,”uid”:"315”, “foo”: “baz”}]))

I need to create json that looks like:


Session(payees → Vector([{“disabled”:false,“uid”:“314”}],[{“disabled”:true,”uid”:"315”}])

I need to create a json string that looks like:

{“account” : “123”, “amount” : 123.45, “payees”: [{“uid”: “314”, “disabled”: false}, {“uid”: “315”, “disabled”: true}]}

In my scenario, I post a request that gets an array of payees. I store it in the session. I then need to transform the result so it looks like the above json. What is the general approach that you suggest?

Thanks in advance,