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.
Sign In or Register to comment.