Duplicates created when importing apkg in 2.1.46

I’m confused about the results of importing with one of my workflows and would like to check that it’s expected behavior.

For testing, working with two accounts, let’s call them “Creator” (the maker of the deck) and “User” (who imports the apkg).

Creator:

  • creates notes in text file. All notes have a unique first field, e.g. 7101
  • in browser, delete all notes from the shared deck (but not the deck itself). This is so that if note 7200 is inserted between notes 7105 and note 7301 in the text file, the latest online version will not place note 7200 at the end of the deck
  • import all notes from text file
  • sync
  • update the shared deck on Ankiweb

User:

  • download new apkg file
  • double-click apkg file

Result:
All cards are seen as new cards and are added to the deck, even though all Field 1 are duplicates. In other words, Anki does not force Field 1 to be unique.

Is there a way to prevent this?

Note: If, instead of deleting all cards in the Creator’s browser and importing everything fresh, I just import the text file again, then sync, then update the shared deck on Ankiweb, then when User double-clicks the apkg, only the new cards are imported.

For reference, here’s the deck I’m working on.
https://ankiweb.net/shared/info/2005964455

When importing .apkg files, the card/note ID is used for duplicate checking. When importing text files, the first field is used for duplicate checking.

1 Like

Thank you, Damien. Just so I understand, is this card/note ID something over which I have control, or is it generated by Anki each time a card is imported / created? I don’t see that field in the browser.

IDs are assigned when cards are created, and Anki does not expose a way to modify them. They can be seen in the card info screen in the Browse screen.

Thank you. Very clear.
Wishing you a great week.

1 Like