Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revisionBoth sides next revision
dev:client_coding:javascript_api [2018/09/05 18:06] – [Managing citations and bibliographies] Add brackets for getNote() zuphilipdev:client_coding:javascript_api [2018/09/08 17:16] – [API Methods] new subsubsection about creating a new collection zuphilip
Line 199: Line 199:
 // or you can obtain an array of itemIDs instead: // or you can obtain an array of itemIDs instead:
 var itemids = collection.getChildItems(true); var itemids = collection.getChildItems(true);
 +</code>
 +
 +=== Create a New Collection in a function ===
 +
 +<code javascript>
 +async function createCollection(name) {
 +    let collection = new Zotero.Collection();
 +    collection.name = name;
 +    var collectionID = await collection.saveTx();
 +    return collectionID;
 +}
 </code> </code>
  
dev/client_coding/javascript_api.txt · Last modified: 2022/07/02 18:22 by dstillman