Need to change JSON response

Hello Community,

I want to 9know how can I get below JSON response

{
“pvProjectID”: “2427827wj”,
“p6ActivityList”: [
{
“pvPprojectID”: “smhcvxsn,x”,
“pvActivityId”: “mxcxzvcb”,
“imo_Vorgangskategorie”: null,
“okz_Komponentenstruktur”: “01”,
“imo_Prozessnummer_Code”: “.Jnxbz1”,
“imo_ZugNummer”: “0m,xzn7”,
“imo_WagenNummer”: “Z”,
“activityName”: “xzb IT”,
“plannedFinishDate”: “2029-02-14T17:00:00.000”,
“blProjectFinish”: “2029-02-14T17:00:00.000”
},
{
“pvActivityId”: “FmzbxzcD”,
“imo_Vorgangskategorie”: null,
“okz_Komponentenstruktur”: “xzbvbzx1”,
“imo_Prozessnummer_Code”: “bxz0”,
“imo_ZugNummer”: “0z7”,
“imo_WagenNummer”: “Z”,
“activityName”: “cxcxzx g”,
“plannedFinishDate”: “2029-03-08T17:00:00.000”,
“blProjectFinish”: “2029-03-08T17:00:00.000”
}
],
“errorText”: “string”
}

Right now I managed to get response in below format

Can some one help me here

Hi @swatifunde,

It would be good if you add the structure of incoming data. It would be easier to help you.

Thanks,
Pero M.

thanks for your response, I don’t have access on source system to change response

Is there anyone who can help me with this ??

@swatifunde - I believe that @pmancevski was simply asking for you to paste the textual response you currently have so we can work towards the format you need. It makes coming up with the expressions easier if you don’t need to try to recreate the original structure.

Sorry for misunderstanding…

Below response what I get from Snaplogic

[
{
“pvPprojectID”:“F363fdfIPP”
“pvActivityId”:“F3swss15AD010O”
“imo_Vorgangskategorie”:null
“okz_Komponentenstruktur”:“R.A.D.01”
“imo_Prozessnummer_Code”:“J.115”
“imo_ZugNummer”:“036”
“imo_WagenNummer”:“Z”
“activityName”:“Durchführung Inbetriebnahme Zugsicherungssystem”
“plannedFinishDate”:“2029-01-04T17:00:00.000”
“blProjectFinish”:“2029-01-04T17:00:00.000”
“test”:“F362fdfdaIBS”
}
{
“pvPprojectID”:“F36sd0IPP”,“pvActivityId”:“F3639C036ZJ131AD010M”,“imo_Vorgangskategorie”:null,“okz_Komponentenstruktur”:“R.A.D.01”,“imo_Prozessnummer_Code”:“J.131”,“imo_ZugNummer”:“036”,“imo_WagenNummer”:“Z”,“activityName”:“Durchführung Inbetriebnahme Train IT”,“plannedFinishDate”:“2028-12-21T17:00:00.000”,“blProjectFinish”:“2028-12-21T17:00:00.000”
}
{
“pvPprojectID”:“Fd00IPP”,“pvActivityId”:“F3639C036ZJ115AD010P”,“imo_Vorgangskategorie”:null,“okz_Komponentenstruktur”:“R.A.D.01”,“imo_Prozessnummer_Code”:“J.115”,“imo_ZugNummer”:“036”,“imo_WagenNummer”:“Z”,“activityName”:“Lauffähigkeitsbescheinigung vor dynamische IBS / dynamische Fahrten”,“plannedFinishDate”:“2029-01-04T17:00:00.000”,“blProjectFinish”:“2029-01-04T17:00:00.000”
}
{
“pvPprojectID”:“F36sd-00IPP”,“pvActivityId”:“F3639dD010N”,“imo_Vorgangskategorie”:null,“okz_Komponentenstruktur”:“R.sdD.01”,“imo_Prozessnummer_Code”:“J.131”,“imo_ZugNummer”:“036”,“imo_WagenNummer”:“Z”,“activityName”:“Durchführung Inbetriebnahme Train IT”,“plannedFinishDate”:“2029-01-11T17:00:00.000”,“blProjectFinish”:“2029-01-11T17:00:00.000”
}
{
“pvPprojectID”:“F3sda00IPP”,“pvActivityId”:“F3639sa85AA__0C”,“imo_Vorgangskategorie”:null,“okz_Komponentenstruktur”:“R.d.A”,“imo_Prozessnummer_Code”:“J.d185”,“imo_ZugNummer”:“036”,“imo_WagenNummer”:“Z”,“activityName”:“Parken”,“plannedFinishDate”:“2029-02-22T17:00:00.000”,“blProjectFinish”:null
}
{
“pvPprojectID”:“F36dc0IPP”,“pvActivityId”:“F3dJ185AA__0A”,“imo_Vorgangskategorie”:null,“okz_Komponentenstruktur”:“R.AaA”,“imo_Prozessnummer_Code”:“Jd185”,“imo_ZugNummer”:“036”,“imo_WagenNummer”:“Z”,“activityName”:“Parken”,“plannedFinishDate”:“2028-12-28T17:00:00.000”,“blProjectFinish”:“2028-12-28T17:00:00.000”
}
{
“pvPprojectID”:“F36dsIPP”,“pvActivityId”:“F363sd104”,“imo_Vorgangskategorie”:null,“okz_Komponentenstruktur”:“R.Asd.01”,“imo_Prozessnummer_Code”:“J.1sa20”,“imo_ZugNummer”:“036”,“imo_WagenNummer”:“Z”,“activityName”:“Betreuung Infrastruktur- / Integrationsprüfungen AM”,“plannedFinishDate”:“2029-01-18T17:00:00.000”,“blProjectFinish”:“2029-01-18T17:00:00.000”
}
{
“pvPprojectID”:“F3d00IPP”,“pvActivityId”:“F3sdD0105”,“imo_Vorgangskategorie”:null,“okz_Komponentenstruktur”:“RsdD.01”,“imo_Prozessnummer_Code”:“J.a120”,“imo_ZugNummer”:“036”,“imo_WagenNummer”:“Z”,“activityName”:“Betreuung Infrastruktur- / Integrationsprüfungen LT”,“plannedFinishDate”:“2029-02-08T17:00:00.000”,“blProjectFinish”:“2029-02-08T17:00:00.000”
}
{
“pvPprojectID”:“F36dIPP”,“pvActivityId”:“F363sd0AD0107”,“imo_Vorgangskategorie”:null,“okz_Komponentenstruktur”:“Rdsa1”,“imo_Prozessnummer_Code”:“J.120”,“imo_ZugNummer”:“036”,“imo_WagenNummer”:“Z”,“activityName”:“Betreuung Infrastruktur- / Integrationsprüfungen AM”,“plannedFinishDate”:“2029-02-14T17:00:00.000”,“blProjectFinish”:“2029-02-14T17:00:00.000”
}
{
“pvPprojectID”:“F36sd-00IPP”,“pvActivityId”:“F36aAD010E”,“imo_Vorgangskategorie”:null,“okz_Komponentenstruktur”:“R.Ad.01”,“imo_Prozessnummer_Code”:“J.090”,“imo_ZugNummer”:“036”,“imo_WagenNummer”:“Z”,“activityName”:“Software / Hardware Hochrüstung nach Einmalprüfung”,“plannedFinishDate”:“2029-03-01T17:00:00.000”,“blProjectFinish”:“2029-03-01T17:00:00.000”
}
]

@swatifunde - I think this example will reformat the response into what you are looking for.
Community 13477 - Restructure JSON_2022_09_26.slp (7.3 KB)

I don’t see where you are getting the pvProjectID value from the provided response data, so I hardcoded that value in the Mapper snap, but I’m guessing you will have that value from either the $original object in the response data, or via pipeline parameter for the pipeline that made the call.

2 Likes

Thanks you so much your response but I am fetching data from Orcale system when I used this logic in my pipeline, I am getting different result

SnapLogic Community below is my pipeline structure