Open TobiasNx opened 11 months ago
Currently, the CSV encoder writes literals (values) as they come in, without giving any regard to their names. Hence, if the input order is unstable, the output will be inconsistent.
A potential solution might be to write values in the order they were first received, which is also the order of the column headers. But this will get somewhat complicated when also taking repeated fields into account.
Task: map incoming data to header order, add new row in header, if element does not exist.
In my example here: https://github.com/TobiasNx/metafacture_workflows/commit/16308bc44ab961f3beaeef0497479e1124aedc09
The outputted csv seems to have sometimes mixed up the columns. This seems to be due to order of the incoming stream:
If I output the json, the issue seem to be created by a variation in the output order: