Possible in native Wappler: Convert nested JSON (API response) into a CSV, correctly formatted?

Hi all,

Wondering if this is possible in wappler.

I have an API returning nested (and in some cases, quite deep) JSON. I’d like to convert this into a CSV file that the user can download - but I don’t need to send the entire JSON output, just the important fields/data points.

Whatever approach I take, I just end up with [object] [object] etc. in the ‘data’ column.

I have tried outputting directly into a export CSV, tried using a SetValue and constructing the schema I want and outputting into a csv - I’m able to output the file, but cannot seem to structure the data in the csv.

Any ideas how I might do this in native Wappler? If it’s not possible, I’ll look for a NPM package that might be able to help.

1 Like

For a nested complex JSON, what would be the expected format be in a CSV? CSVs are basically flat data structures. How would anyone identify what value comes from what key?

(Asking just for the sake of understanding the concept. I’m not sure if this actually possible in Wappler.)

1 Like

This would make a nice custom module.

Unfortunately I don’t have time to build something so specific as I don’t see myself using it in the short/medium term.

2 Likes

@sid - simple columns, with some columns repeated to handle certain nested data. Using an external service like json2csv and klonbert do an OK job via their API, but they aren’t perfect - so I was wondering if there was a way I could handle the data within Wappler somehow, restructure it and then output it correctly, but looks like i’ll need an external servie.

Thanks @JonL - I came across this one, too! Looks like it’s this, or Klonbert via API might do the trick, that or Parabola and use Parabola to clean the data then insert.

1 Like