TiddlyWiki / TiddlyWiki5

A self-contained JavaScript wiki for the browser, Node.js, AWS Lambda etc.
https://tiddlywiki.com/
Other
8.02k stars 1.19k forks source link

XLSX importer not appending fields to list field #2938

Open Marxsal opened 7 years ago

Marxsal commented 7 years ago

After testing the XLSX importer it appears that list fields are overwritten, not appended, even when specification asks to append field. The original example data, had no situation where a list field would be populated by more than one entry.

tobibeer commented 6 years ago

How would "appending" even work with the importer?

Marxsal commented 6 years ago

Take a look at the sample data. Duplicate the entry for "Barak Obama" from the president's worksheet and change the State to illinois. Run the import. Barak Obama's entry should now be tagged with both "Hawaii" and "Illinois". But instead it's tagged only with Illinois (or whichever new entry was last). In affect, list fields are not actually appended, but written over. If nothing else, the terminology should be changed to reflect the reality.

tobibeer commented 6 years ago

What I mean is, when we import, don't we always overwrite ...or do the XLSX tools behave differently?

So, this is what I would suspect, indeed:

If nothing else, the terminology should be changed to reflect the reality.

Marxsal commented 6 years ago

Structured data like spreadsheets adds the possibility of one-to-many relationships. The way 1-to-many is implemented in TW is via lists. Appending a tag would be a natural way to incorporate those relations, and appears to have been the intent in the original project. All the other field importers very deliberately say "set" -- only the list importer says "append".

tobibeer commented 6 years ago

Ah, you mean one could have certain tiddler lines duplicated so as to add more details for a specific column, then imported as items to a list?

Marxsal commented 6 years ago

Yes, exactly.

Jermolene commented 6 years ago

Hi @Marxsal the present behaviour of overwriting tiddlers extracted from each row of a sheet is intentional, in so far as it is a consequence of the design and implementation. I made a minor tweak to the docs in 920d225f3765aa709ed8a6c7a2566ff968fade02. However, certainly I'd be interested in supporting the idea you've outlined.