JS Collection.name returns undefined

edited February 3, 2021
How can I get the name of the collection?

I'm having trouble with a little script,
var collections = selected[0].getCollections();
var collection1 = collections[0];
return collection1.name;


When I return collection1.name the result is: (undefined)

When I return collection1 the result is: 5331 (number)
  • I finally found a solution for my issue, adding the get function:
    var collection1 = Zotero.Collections.get(CollectionID);

    hopefully this will save someone else alot of time.

This is an old discussion that has not been active in a long time. Before commenting here, you should strongly consider starting a new discussion instead. If you think the content of this discussion is still relevant, you can link to it from your new discussion.

Sign In or Register to comment.