How to convert a JSON response from a Scripted rest api into CSV?

Akshatha Ballal
Tera Expert

I have a JSON response from a scripted rest API which I need in a csv format. If I append ?CSV at the end of the GET rest url, the csv file is empty. How do I convert the data from json to csv? Any help on this is appreciated.

 

3 REPLIES 3

Pradeep Sharma
ServiceNow Employee
ServiceNow Employee

Hi Akshatha - You may find below thread helpful.

https://stackoverflow.com/questions/8847766/how-to-convert-json-to-csv-format-and-store-in-a-variabl...

 

- Pradeep Sharma

Ankur Bawiskar
Tera Patron
Tera Patron

Hi Akshata,

So you are getting a response in json format and you want to convert the data from json to csv file? where this file will be attached to which record?

you will have to parse the json and create csv file and attach to some record

Please share some details on how the setup looks currently.

Regards
Ankur

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader

G_30
Tera Contributor

Hi, did you able to solve it?