neo4j-labs / neodash

NeoDash - a Dashboard Builder for Neo4j
https://neo4j.com/labs/neodash/
Apache License 2.0
397 stars 129 forks source link

Reports: Table CSV Export not formatted properly when using COLLECT(DISTINCT()) #835

Open geoffinfosecpersona opened 3 months ago

geoffinfosecpersona commented 3 months ago

The exported CSV from Neodash differs from the exported CSV from the Neo4j Browser, with the Neo4j Browser export respecting lists as a single column, and the Neodash export treating list entities as individual columns.

In short, it looks like the CSV export process treats commas as delimiters, which causes issues when using a COLLECT(DISTINCT()) on tabular fields, as the lists generated by the COLLECT(DISTINCT()) have the entities in the list separated by commas.

To help us understand your issue, please specify important details, primarily:

MATCH (n:Movie)
OPTIONAL MATCH (n)-[:ACTED_IN]-(b)
OPTIONAL MATCH (n)-[:DIRECTED]-(c)
OPTIONAL MATCH (n)-[:PRODUCED]-(d)
RETURN 
n.title AS `Movie Name`
, COLLECT(DISTINCT(b.name)) AS `Actors`
, COLLECT(DISTINCT(c.name)) AS `Directors`
, COLLECT(DISTINCT(d.name)) AS `Producers`
geoffinfosecpersona commented 3 weeks ago

@nielsdejong - Is there a status update for this bug? Thank you!

nielsdejong commented 1 week ago

Hi @geoffinfosecpersona , Thanks for reporting this. To fix this we'll need to make the CSV delimiter configurable as an advanced setting for the table report - you can then choose to go for semicolon or tab, etc.

For now you can probably work around it by using apoc.text.join to turn the list into a ';' seperated string, but it will probably be nicer to customize the CSV delimiter instead.

geoffinfosecpersona commented 1 week ago

Brilliant, @nielsdejong. I'll give that a shot. Thank you!!

Hi @geoffinfosecpersona , Thanks for reporting this. To fix this we'll need to make the CSV delimiter configurable as an advanced setting for the table report - you can then choose to go for semicolon or tab, etc.

For now you can probably work around it by using apoc.text.join to turn the list into a ';' seperated string, but it will probably be nicer to customize the CSV delimiter instead.