AnsweredAssumed Answered

Create CSV from Array in JSON

Question asked by faheem.iqbal080927 on Feb 22, 2017
Latest reply on Mar 23, 2018 by brian.wilkinsonc3

Hi,

Please advise how I can create CSV file or flat profile from incoming array in JSON as shown below where Key will be the column header and value will be column header value in CSV file:

{
 "formType": "",
 "serviceCategory": "",
 "reasonCategory": "",
 "ticketSubject": "",
 "ticketPriority": "",
 "ticketStatus": "",
 "sourceSystem": "",
 "channelCode": "",
 "noteType": "",
 "noteText": "",
 "additionalFields": [{
  "key": "Title",
  "value": "Mr"
 }, {
  "key": "Name",
  "value": "JOHN"
 }, {
  "key": "Surname",
  "value": "SMITH"
 }],
 "customerDetails": {
  "customerID": "",
  "fullName": "",
  "telephone": "",
  "email": ""
 },
 "attachments": [{
  "attachmentType": "",
  "attachmentURL": "",
  "attachmentBinaryObject": "",
  "attachmentDocumentTitle": "",
  "attachmentComment": ""
 }, {
  "attachmentType": "",
  "attachmentURL": "",
  "attachmentBinaryObject": "",
  "attachmentDocumentTitle": "",
  "attachmentComment": ""
 }]
}

 

So end result required in CSV file should be like this:

Title, Name, Surname

Mr, John, Smith

Outcomes