Hi Suhas M V,
{
"searchresult":{
"address":[
{
"sequenceNumber":1,
"country":"US",
"city":"NEW YORK CITY",
"line":"1234 ECDC ST",
"latitude":40.7204,
"stateProvince":"NY"
},
{
"sequenceNumber":2,
"country":"US",
"city":"NEW YORK CITY",
"line":"1234 ECDC ST",
"latitude":49.7204,
"stateProvince":"NY"
}
],
"email": [
{
"sequenceNumber":1,
"precedenceCd":"ONE",
"type":"WORK",
"value":"abc@xx.com"
},
{
"sequenceNumber":7,
"precedenceCd":"ONE",
"type":"PERSONAL",
"value":"xxx@gmail.com"
}
]
}
}
Thanks a lot for your reply
,
yes, its working for one node and one entry but we need to apply for multiple nodes in response like email and telephone and some time response coming with array format( like below), that time its applying two time [] brackets.
Original Message:
Sent: 10-20-2019 12:38 AM
From: Suhas M V
Subject: JSON response in array format
Hi Uday,
You can use Evaluate Regular Expression with Match & Replace Option to get this output.
Find : ("address":)(.*?)}
Replace : "address":[$2}]
Thanks !
Original Message:
Sent: 10-18-2019 08:13 AM
From: Uday Reddy
Subject: JSON response in array format
Hi Team,
Can you please help me on below requirement.
we have requirement to format the JSON response into array structure ( highlighted structure in expected response ) , please find below response JSON and expected JSON.
Json response
------------------
{
searchresult:{
"address": {
"sequenceNumber": 1,
"sequenceNumber": 1,
"country": "US",
"city": "NEW YORK CITY",
"line": "1234 ECDC ST",
"latitude": 40.7204,
"stateProvince": "NY"
}
"email": {
"type": "WORK",
"sequenceNumber": "1",
"precedenceCd": "ONE",
"value": "abc.p.abc@xx.com"
}
}
}
Expected Response
-------------------------------
{
searchresult:{
"address": [{
"sequenceNumber": 1,
"country": "US",
"city": "NEW YORK CITY",
"line": "1234 ECDC ST",
"latitude": 40.7204,
"stateProvince": "NY"
}]
"email": [{
"type": "WORK",
"sequenceNumber": "1",
"precedenceCd": "ONE",
"value": "abc.p.abc@xx.com"
}]
}
}
Appreciate your help on this.
thanks in advance,
--Uday.