Skip to content
This repository has been archived by the owner on Dec 31, 2023. It is now read-only.

addNote error: Exception: cannot create note because it is empty #240

Open
valuex opened this issue Mar 5, 2021 · 1 comment
Open

addNote error: Exception: cannot create note because it is empty #240

valuex opened this issue Mar 5, 2021 · 1 comment

Comments

@valuex
Copy link

valuex commented Mar 5, 2021

I've update AnkiConnect for Anki 2.1.38 today.
And get an error message as:

Exception: cannot create note because it is empty

Kindly help to point out how to fix it, thanks.

#!/usr/bin/env python

import util

def runTest():
    options = {
        'allowDuplicate': True
    }

    note1 = {
        'deckName': 'NewWords',
        'modelName': 'Basic',
        'fields': {'Front': 'front1', 'Back': 'back1'},
        'tags': ['tag1'],
        'options': options
    }

    # addNote
    noteId = util.invoke('addNote', note=note1)

if __name__ == '__main__':
   runTest()
@valuex
Copy link
Author

valuex commented Mar 6, 2021

Huh, My fault. I changed the fields name as Front and Back, and get it solved.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant