CSV export does not stringify arrays properly
See original GitHub issueIf your collection has an array, the exported csv will show something like:
[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
for that particular field.
Maybe it’s possible to print these nested collections in a better way? Not exactly sure how, but something like YAML style sounds appropriate.
Let me know what you think. I don’t mind working on this if its not a priority for you.
Issue Analytics
- State:
- Created 2 years ago
- Comments:6 (6 by maintainers)
Top Results From Across the Web
How to export JavaScript array info to csv (on client side)?
You can do this in native JavaScript. You'll have to parse your data into correct CSV format as so (assuming you are using...
Read more >Convert an array of objects to CSV string in JavaScript
So, how do we get from an array of objects to a CSV string while ensuring that the correct data will be displayed...
Read more >objects-to-csv - npm
Converts an array of JavaScript objects into the CSV format. You can save the CSV to file or return it as a string....
Read more >CSV.parse , CSV.stringify — a capable, easy-to-use CSV parser
This is a JavaScript module that can parse and create CSV files. The parser can be configured with different options to separate table...
Read more >How To Read and Write CSV Files in Node.js Using Node-CSV
Most spreadsheet programs and databases can export and import CSV files. Because CSV is a plain-text file, any programming language can parse ...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Ah yes, serialising arrays of objects in CSV files is a problem! There seems not to be a preferred way to do it. The way I would go with it is to include the data as a JSON probably. We are currently not using YAML anywhere within the app. It probably makes sense to include some exporting options in that dialog, such as how to serialise arrays, or date formats (unix timestamps vs ISO8601). Regarding the setup I use locally, I use yarn to link the main project with the example project.
yarn link
in the main library folderyarn link @camberi/firecms
in the project you would like to have FireCMS as a dependency. Thanks!!Hi @PupoSDC, let’s continue the discussion at https://github.com/Camberi/firecms/issues/82 and leave this issue for the CSV export discussion 😃