Updating cards using the AnkiConnect API

In my program I want to implement the function to update a card. I am using the AnkiConnect API to do so and within this add-on the “updateNoteFields” action. More specific. I want to remove an Image field from an existing card. I cannot get this to work. I tried to leave the “picture” object completely out of the fetch function as well as just setting it to null, so leaving it empty. I also tried to change the modelName to one that does not include the Image field. But it did not work too.

Do you have any more ideas, beside deleting the image from the media file, since this would probably result in displaying an error message of “File not found” on the card, what would be ugly.


Setting params['note']['fields'][your_image_field_name] to an empty string should work. The image won’t be deleted from the media folder this way, but that’s better done manually using Tools > Check Media.