How to convert JSON to CSV or create records
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-19-2023 11:30 AM - edited 12-19-2023 11:33 AM
Hello experts,
I am working on converting JSON response to create a CSV file, so i can create a data source record sys_data_source.
Please could you help me in either JSON response to converting csv attachment or directly inserting it my staging table.
Background: I have the staging table created with all columns from json response. I used online sites to convert the attached JSON to csv and uploaded in Staging table. But I want scheduled job or script to do this conversion to csv or insert of records directly in to staging table.
Please see the attached JSON response. I am new with JSON and integrations. so any advise or code will be very helpful.
Regards,
Newbie

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-19-2023 11:40 AM
You can definitely use CSV. But if you already have JSON, you can pass the JSON as content or attach the JSON file to the data source and then set the format in the data source as JSON and run import to import the JSON.
ds.format = "JSON";
Please mark this response as correct or helpful if it assisted you with your question.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-19-2023 11:58 AM
Thank you Sanjiv for the response. I was not aware of the JSON file datasource.
What should i put value for "Path for each row"

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-19-2023 12:46 PM
So depends on your payload.
If your JSON array doesnt starts from the begining, you can use
ds.jpath_root_node = "//";
If it is inside a JSON, you can specify the path, for ex
ds.jpath_root_node = "/results/results";
Please mark this response as correct or helpful if it assisted you with your question.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-19-2023 12:23 PM