Editing multiple items at once

It would be very helpful, if it were possible to edit multiple items in one go.

The idea I have in mind is as follows:
1. Select the entries you want to edit.
2. Zotero updates the entry form to become a combined form:
a) Fields, which have the same values across all items, are displayed with this value
b) Fields, which have entries, but different values, are marked (e.g. with a grey background)
c) Fields, which are empty across all selected items, remain empty
3. If a user edits any field, the entered value is written to _all_ selected items.

It might be better to "hide" this feature in the menu, to prevent accidentally editing many, many items destroying your database. Zotero might display the entry form as described in 2., but an extra step is needed to unlock the editing feature …

Here is the scenario, where I desperately longed for this feature: I imported all pdf papers of a conference I attended. I had to go through each of them and change the Item type, the Conference name, the Proceeding name, the Date and the Place.
  • Yes, batch editing like this is planned — just hasn't happened yet.
  • Thanks, that's good news. Any ideas when this might happen?
  • A good use case is where I am scanning archives from multiple boxes in our State Library, and each box has many documents. The collection has a single library call no, which I would like to include on each of the hundreds of Zotero records (one for each document or letter), but I would need to add it manually. I am using the add-in from my browser as I page through each file I have scanned and uploaded to OneDrive.
  • Many batch editing tasks can be accomplished in a relatively simple manner with the Zutilo add-on.

    The Zutilo functions for batch editing of item metadata are: "Copy item fields", "Paste into empty item fields", "Paste non-empty item fields", "Paste all item fields", and "Paste item type". They are explained in Zutilo's Command reference. Use cases are discussed in the Usage notes. For some functions you need to use a text editor for editing the JSON data that are copied to the clipboard.

    It's also possible to script more complex operations with Zotero's JavaScript API.
  • Thanks qqbb for the quick response. I have installed Zutilo and it will probably do what I want.
    Testing so far shows that Copy Item Fields > Paste into non-empty items works. However, as documented, it adds the Author from the copied item as an extra author on those pasted into, which is not correct in my case. A bit more testing needed.
  • You could, e.g., paste to a text editor, remove the authors, then paste into empty fields.
  • edited 14 days ago
    @qqbb Unfortunately, Zutilo doesn't allow to paste when it detects that the copied content is not the last content you copied with the very Zutilo copy item function. So, if you modify it a little with an editor and copy it, there's no way to paste it (the paste options in the menu won't appear).
    A further workaround built upon what you said (thanks for the idea) would be to create an empty item in Zotero; you'll have to select at least an item type, but the rest of the fields would be empty, and you can fill there the field you're interested to paste to several other files as you said...
  • That shouldn’t be the case. Can you show the original and edited text as an example here?
  • @Mart: If you edit the JSON text, you need to keep the itemType name/value pair as explained in the Command reference's description for the "Paste all item fields" function:
    To edit specific item fields, select a source item and use "Copy item fields". Paste to a text editor, edit the JSON text, then copy the modified text back to the clipboard. Finally, select the target items and use "Paste all item fields". The itemType name/value pair needs to be kept in the JSON text because Zutilo uses its presence to decide whether to use the paste JSON commands in the context menu; its value is irrelevant for this function. You can, e.g., clear the URL field in multiple items by pasting {"itemType": "book", "url": ""}, which will not change any item types.
    Also, make sure that your JSON is valid. You could consider using an online tool like https://jsoneditoronline.org/ which shows a red warning message if your JSON isn't valid. (The wrench button fixes your syntax errors.)

    It could also be helpful to work with duplicated Zotero items. Right-click on an item and choose "Duplicate Item". This might be easier than working with the JSON text.

    If you're still experiencing issues, you could share your JSON text as bwiernik suggested. Post your code to https://hastebin.com or https://pastebin.com/ and provide a link here.
  • Oh, thanks a lot @qqbb, and @bwlernik. Yes, indeed, both keeping the itemType name/value pair and checking the JSON for errors (message for others: be careful to delete the last comma left, if you delete the last field) solved it. I can paste now the JSON modified in a text editor without further "workarounds". Thanks & best!
Sign In or Register to comment.