Attempts to update note when uploading CSV is failing

So I’ve googled and searched the forum and have not stumbled across anything that seems relevant.

In short, I want to regularly upload a csv file that will contain a variety of new entries as well as a variety of updates to pre-existing entries. The data I want to upload/maintain in ANKI is in a separate system and I use XL to download the data, make some formatting changes, organize the data in to columns that map the Note Type I created, upload, and have the data in ANKI then synched up with the source data. I can’t get ANKI to recognize existing rows. Here’s what I’ve done.

I understand how the GUID works after playing with it for a bit and can successfully make updates with that, but the problem is that with my source data in another system, that would require maintaining a side table in my spreadsheet to line up unique IDs from the source data with the ANKI GUIDs. I’m not a developer and really just trying to keep things XL/CSV based and tinkering around with exporting files to harvest the GUIDs of new entries at map them in a separate table is a huge PIA as updates will happen at least once a day and I’d like to be able to do it more frequently.

So, in the Note Type that I created, I have a field called “key”. In my initial upload to ANKI I put a unique ID in that field. That unique ID is the first column in my CSV file as well as the sort column in the Note Type. I’ve been playing with trying to update the tag on a single note based on this Unique ID being the first column in the csv and it always ends up creating a duplicate.

Here’s a screen shot of my import file:

And here is a screen shot of the associated note that I want to update:

When I kick off the import, this is what I see. The first column reflects the Unique ID and I can see the tag that I´m adding in the tag field second from the far right (two images):


And after clicking import, I´m told that one row has been added and I can see that new note in the browser. Anki even complains about the duplicate by turning the “key” field red to let me know that there’s more than one row with that value:

What on earth am I missing?

Thanks.

I’m wondering if something is going on with all the ways you’re referring to decks.

  • Your notes-mode Browse window says that the existing cards are in 2 different decks – which seems like it must be due to a deck override in your note type, since the cards are eventually created in 2 decks.
  • But you’ve also got a column in your CSV labelled “deck” – although it’s (1) empty and (2) not designated in the headers as the decks column – so what is that?
  • But then in the import options you’re specifying a single deck as the destination, not 2.
  • But you’re also telling update to match on note type and deck.

That might be too much overlapping and conflicting information for the import logic to match.

Hmm…I think that’s good food for thought.

I do automatically create two cards from each note, both cards going into subdecks of the desk into which the notes are loaded. I can see now the potential for complication.

I’ll have to tinker around and see what I can do with that. I’m not super confident I understand exactly where things are stored. I feel like I’m loading my notes into the parent desk and my cards are being created in the subdesks…but clicking on the parent shows me the notes and both sets of cards…and clicking on one of the children shows me the half of the cards that belong there along with the original notes.

If I update a note manually in the GUI, it does seem to update everything correctly, so I’ll try just getting rid of the extra desk fields that I’m not using in this upload.

Thanks for the tip. That is something that had clearly not occurred to me.

Maybe this will help – notes are never in a deck.

A note is a collection of related information, and its note type carries the instructions that tells Anki what cards to create from it. Anki then puts those cards in decks – either a single deck that you specify when you add the note, or multiple decks based on Deck Override instructions from the note type.

When you click on a deck and switch to Notes mode, you aren’t seeing notes that are in that deck, you are seeing notes that have cards in that deck. But those notes might have cards in other decks too.