Jump to content
Ghanshyam Rajpurohit

Not able to remove all tag for existing note. while updating it.

Recommended Posts

Hi ,

I was trying code in python for updating note. 
 


note_obj = note_store.getNote(token, reqpara_note["ntdtanoteguid"], True, False, False, False)

I came across i was not able to remove all tag from note.


if taglist is not None:    note_obj.tagNames = taglist # here it will have list ['newtag','todo']else:    note_obj.tagNames = None

I tried to remove this tag in my code way , just updated the tagGuids to None

note_obj.tagGuids = Nonereturnnote = note_store.updateNote(token, note_obj)

I was able to updated the tags (add or remove) for a Note

yeha! tag is not deleted from account. I don't need to delete. It should just remove from the note i want to update .

probelm:

When I try to remove the last tag (i.e there is only one tag to the Note) It not get removed returnnote   do have that last tag  with him .
I don't know why?
u can also try to add many tags to note and then remove all tag at once the returnnote will return list of tag again.

Any body have solution? or Why ?

Share this post


Link to post

no ans yet hmm. -_-
 

 note_obj.tagGuids = []

This will remove the all tag for the note .

And for setting them just pass list name
 

note_obj.tagNames = taglist # here list can be ['newtag', 'todo', 'soultion']

:rolleyes:

Share this post


Link to post

A couple of things...

 

First, this isn't the best forum to post coding topics - use the "Evernote for Developers" forum.

 

In terms of tags on a note - as I think you've discovered, the TagGuids property is the official field that holds the tags assigned to a note.  That's what you use to manipulate a note's tags.   TagNames is just a shortcut to be able to add tags to a new note by name; they are only used when creating a note - this property is not populated for an existing note.

 

This is explained in the documentation for the Note object:

 

tagGuids A list of the GUID identifiers for tags that are applied to this note. This may be provided in a call to createNote() to unambiguously declare the tags that should be assigned to the new note. Alternately, clients may pass the names of desired tags via the 'tagNames' field during note creation. If the list of tags are omitted on a call to createNote(), then the server will assume that no changes have been made to the resources. Maximum: EDAM_NOTE_TAGS_MAX tags per note   tagNames May be provided by clients during calls to createNote() as an alternative to providing the tagGuids of existing tags. If any tagNames are provided during createNote(), these will be found, or created if they don't already exist. Created tags will have no parent (they will be at the top level of the tag panel).

Share this post


Link to post

thanks Phils you explained nicely...
i was bit confused as accepting the None for tagGuid but not setting it to None was bit confused.....
n ok as i was developing  third-party app so........ any way thanks i will post my question for coding over "Evernote for Developers" forum.
and thanks again. :) :)

Share this post


Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×
×
  • Create New...