Field Type Mapping

I have a suggestion for field mapping from CSV… I’m trying to import multiple note types from a single CSV, but they have different field names and the CSV import doesn’t use the #columns line to match fields. This is forcing me to get very creative with if/else statements in my Google Sheet, in order to get the columns to appear in the right order for each different note type.

The overall goal is to be able to switch between recognition and production language-learning cards with just one column in my spreadsheet. That column determines note type because production cards use cloze deletion, but that doesn’t work well for recognition cards so I need to switch to a basic type.

It would be significantly easier, and make my spreadsheet more readable if Anki paid attention to the #columns line and defaulted to matching any columns whose name was an exact match for a field name, for each note type. Rather than just going by column order. I’m unclear on the actual purpose for the #column line, because I’d assumed it would do just that but it seems to be ignored.

I’m glad you said this – because those shouldn’t be separate rows, separate notes. You can make your recognition and production cards from the same note/note type. If word/phrase needs both card types, your note type can make them. But even if you only want one card for that word/phrase, you don’t need a separate note type for that.

A close type can make Q/A (“basic”) cards pretty easily.

Question
{{c1::Answer}}

You seem to have some sense of the purpose – Text Files - Anki Manual . But obviously you can’t use that to outline the field names for multiple different note types at once. It’s only one line. If you want to have multiple note types in the same file, you need to use the notetype column header.

Thanks for the detailed reply! In my case I’m only ever doing production or recognition. I don’t find it useful to do both, since production is much harder. I just change to recognition for some lesser-known words that I want to recognize in books or podcasts, but I don’t need in my active vocab at this point.

So every line is either one or the other. Seems like the better way would be to make my customized cloze note type produce a basic card or a cloze card depending on a field that specifies whether it’s production or recognition, then. The other struggle with my approach is that if I want to change a note type of an existing card, I can’t do that from the CSV so there’s potential for mis-matches if I change my mind about a word.

I actually tried that initially, keeping everything to one note type. But I struggled to make the Cloze type produce a basic card and gave up, figuring I needed multiple note types instead.

Noted on the #column name line, although it’s entirely possible for it to work the way I expected - just by mapping fields based on name for each line to the note type on a per-line basis, and ignoring whichever columns don’t fit in the note type.

Trying the single note type option again, and I’m still unable to make it work. I see two options:

  1. Generate different cards based on a field. This doesn’t seem possible because a cloze note type can’t make a basic card? I also don’t see a way to add an additional card template at all in a Cloze note.

  2. I could use conditionals to change the output based on a field. This works for the Front template just fine. But, no matter what I put in the Back template, the preview just says “No cloze ⁨1⁩ found on card”. Even if I don’t put any fields or conditionals in the Back template. It’s possible it’s only an issue in the Preview and that I would see my actual template in the iOS app, but I doubt it.

I’m out of time this morning, but next step will be to try again with every note having the cloze text even if I’m not going to use it. That might get rid of that error and allow me to show the back template that I want?

(Currently my Google Sheet uses conditionals to change the Text field from a Cloze to a Recognition text with the target word in bold tags instead - so the recognition notes have no cloze text in them at all)