question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

CSV export does not stringify arrays properly

See original GitHub issue

If 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:closed
  • Created 2 years ago
  • Comments:6 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
fgatti675commented, May 7, 2021

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.

  • So I run yarn link in the main library folder
  • And then yarn link @camberi/firecms in the project you would like to have FireCMS as a dependency. Thanks!!
0reactions
fgatti675commented, May 10, 2021

Hi @PupoSDC, let’s continue the discussion at https://github.com/Camberi/firecms/issues/82 and leave this issue for the CSV export discussion 😃

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found