where to find each reference's unique ID?

I know that each reference saved in Zotero has a unique identifier, but I'm trying to find out where that is saved.

Ultimately, I want to be able to export this field in my .ris file.

Thanks!
  • edited April 16, 2020
    Install the Zutilo plugin. That adds an option in the right-click menu to "Copy Zotero Select Link". The end of that link is the unique ID.

    That said, I don't think this is what you are looking for. What exactly do you want to do with this ID in you RIS file?
  • Thanks, I had seen that but correct that it isn't what I'm after.
    I see that someone else was trying to do the same thing as me (import into Distiller SR) - there isn't a resolution on it though: https://forums.zotero.org/discussion/comment/347953/#Comment_347953

    What I've looked into as options:
    1. I can put a unique ID in the "Extra" field, but there doesn't seem to be a way to easily automate this.
    -- One option would be to manually enter them (very time-consuming)
    -- The other option is to export to csv, add an ID as the "Extra" field (incrementing by 1 each row) and then re-import back to Zotero. (I'd either have to merge all the references or delete the first set after export)

    2. Better Bibtex can generate citation keys, but Distiller requires the ID to be numeric only and I don't see that I could get a stable, unique, numeric ID from the available fields.

    3. Other workaround using EndNote
    I've used Endnote for our Distiller projects in the past, so I could always export to that then to distiller. The issue is that we still need a zotero library for distribution. The import using XML from endnote doesn't automatically put the endnote id into the extra field, but I think I should be able to change that by customizing the translator? I started to try this but I got a bit overwhelmed with it since I'm not very familiar with github repositories and using all of that.
  • So the goal is just to add a numeric id to items so that you can find them in Zotero later based on the results from the meta-review software?

    It would be pretty easy to run some JavaScript to add a numeric id to the Extra field of all selected items in Zotero. We could help with that if you want. You could also do it via the Zotero API using something like pyzotero, though that would be slower.
  • I recommend installing the BetterBibTeX plugin and using its features to assign Citation Keys. This is what I use for my systematic reviews.

    Ideally, I would recommend a format other than RIS, such as Better CSL-JSON or Better BibLaTeX. What formats can DistillerSR import?
  • edited April 16, 2020
    Can BBT generate numeric keys, though? It sounds like that's a requirement here.
  • Thanks both -
    Yes, I need it to be numeric, otherwise BBT's citation key generator would be perfect. DistillerSR only allows import by RIS, CSV, or compressed endnote (ENLX).

    The JavaScript solution sounds like it would work! I figured there was a way to do that. I will see if I can figure it out on my own in the next few days (it seems like it should be fairly straightforward - and good practice). Then if I need more help I will reach out.
  • Sorry, missed that about the limitation of DistillSR.
  • I could have BBT generate numeric keys. I don't know if there are limitations to how large the keys can be for DistillerSR, but if there's no practical limitation, I could just transform the citekeys to their char-code equivalents during export. Or I could expose libraryID and itemKey to the citekey formatter (that combo should be unique right?) and add a filter that does char-codeification.
  • I'm not sure how many characters are allowed, but I'm checking with DistillerSR to see what that limitation is. I'll get back to you @emilianoheyns when I hear from them, but being able to use the libraryID and itemKey with a filter to transform to numeric values seems ideal to me. I just don't want to waste anyone's time if it won't solve the problem.
    Thanks!
  • @emilianoheyns The requirements for the id field for DistillerSR are: numeric values only, up to 9 digits.
    Do you know how long the libraryID and itemKey fields are?
  • edited April 23, 2020
    9 digits won't cut it because mapping to charcodes will at least double the number of places needed.

    I can trivially expose the itemID, but these are bound to the local database. If you sync, the same item is almost guaranteed to get a different itemID. Item merges will also affect citekeys.

    edit: the library ID is numeric but I have several that are 7 digits. The key is 8 positions (IIRC) alphanum, so lets say on average 12 positions with an upper limit of 16. In any case, you immediately cross the 9 threshold.
  • Thanks for the response and help! It sounds like the best solution at this point will be to assign a numeric ID using javascript.
  • The itemID is already numeric? Something like [item-id] would give it to you in the citekey.
  • Oh, perfect. I think that will work, thanks!
  • The itemID isn't stable across computers and shouldn't be used as an identifier.
  • edited April 24, 2020
    That's what I've been saying. This only works locally (unless you pin the keys, buth then you're bound to end up with duplicates). For something that syncs, it seems inevitable that you'll either:

    1. need an Zotero-external database to match numbers to URIs, or
    2. need more (a lot more) places than 9 digits

    assigning numeric keys "with javascript" isn't a solution unless you have a reliable source for unique numbers. The assignment is not the difficult part.
  • As an alternative, I might suggest using the free Rayyan app https://www.ncbi.nlm.nih.gov/pmc/articles/PMC5139140/ instead of DistillR.
Sign In or Register to comment.