You are almost there with the JSON Output
step. the problem is that JSON Output step doesn't handle nested data structures well, so you might want to handle phones
and the other information separately and then merge the results.
Below is an example KTR to handle your task:

JSON Output step: process phones
In the first JSON Output step, set up the following

under Fields Tab
, add two fields: number
and phoneType
. The new field phones
after this step is:
{"phones":[{"number":123456.0,"phoneType":"PRIMARY"}]}
JSON Output step:
do the similar to the above step except the following:
- In General tab, set Json bloc name =
data
, Output Value = outputValue
- In Fields tab, add the fields
firstName
, lastName
, birthDate
and email
The new field called outputValue
added from this step is:
{"data":[{"firstName":"himanshi","lastName":"joshi","birthDate":"1997-07-24","email":"hj@test.com"}]}
Note: you should not retrieve and add phones into the JSON output here since the nested data structure will become a single String value in the final output.
JSON Input step: retrieve $.data[0]
As labelled in the Step name, we use JSON Input step to retrieve $.data[0] from the field outputValue
, so it becomes:
{"firstName":"himanshi","lastName":"joshi","birthDate":"1997-07-24","email":"hj@test.com"}
- In File tab: select
Source is from a previous step
and Select field = outputValue
- In Fields tab, add a new field: Name =
rest_client_data
and Path = $.data[0]
Replace in string step: merge phones
Use the Replace in string
step to merge two JSON strings: phones
and rest_client_data
.

Basically, it replaces the leading brace {
of phones with a comma
and then replaces the trailing }
of rest_client_data with the updated phones
Select values step
To keep only the needed field: rest_client_data
{"firstName":"himanshi","lastName":"joshi","birthDate":"1997-07-24","email":"hj@test.com","phones":[{"number":123456.0,"phoneType":"PRIMARY"}]}