Ghanshyam Rajpurohit 2 Posted June 25, 2015 Share Posted June 25, 2015 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 = NoneI tried to remove this tag in my code way , just updated the tagGuids to Nonenote_obj.tagGuids = Nonereturnnote = note_store.updateNote(token, note_obj)I was able to updated the tags (add or remove) for a Noteyeha! 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 ? Link to comment
Ghanshyam Rajpurohit 2 Posted June 25, 2015 Author Share Posted June 25, 2015 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'] Link to comment
Level 5* phils 220 Posted June 26, 2015 Level 5* Share Posted June 26, 2015 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). Link to comment
Ghanshyam Rajpurohit 2 Posted June 26, 2015 Author Share Posted June 26, 2015 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. :) Link to comment
Recommended Posts
Archived
This topic is now archived and is closed to further replies.