How to convert JSON Object to a CSV file

63 Views Asked by At

I am getting JSON object from RedCAP API.

var result = redcap_api.ExportRecordsAsync(apiToken).Result;

How do I create a CSV file of result? I have installed NuGet packages RedCapAPI and CsvHelper.

1

There are 1 best solutions below

0
On

Do you need the CSV file to be downloaded and saved as a file? Or do you instead need to save the CSV as a variable for later use?

For the first use case, there are a few tools available like this one.

For the second use case, try taking a look here.

Of course, you can likely do both (save the CSV as a file, and then reference the file itself later in the script), but without knowing much more hopefully the above links will help you.