accessing extra fields in CSL/renaming custom field in extra

In my dissertation I refer to a lot of webpages that tend to be taken offline at some moment, so I have archived them online. In Zotero, I have added a line to the extra field to store these, as follows: 'Archived version: https://web.archive.org/web/https://website.com/a-page'.

Now, I'd like to use these in my printed bibliography with a customized CSL file, based on APA 7. To be precise, if an archived version is present for webpages or blog posts (so items with an URL), I want to add the archived version's URL:

A website. (n.d.). A page on that website. Retrieved October 5, 2022, from https://website.com/a-page. Archived version: https://web.archive.org/web/https://website.com/a-page.

I'm using BetterBibTex to export my bibliography to a JSON file. However, in these files the 'archived version' field is added to a 'note' field, which makes it hard to call them in my CSL. I just found out it would have been much easier to use an existing CSL-field (archiveLocation would make sense) in the extra field, since BBT parses these and adds the right keys and variables to the JSON file.

Since I have hundreds of web pages with archived versions in Zotero, I'd prefer not to manually change all the keys in the extra field. Is there a way/place to replace all the 'Archived version'-fields in Zotero with 'archiveLocation'? Or does anyone have a suggestion for another workaround - perhaps I should look for a solution using BBT?

I'm using Zotero 7.0.0-beta.47, with Better BibTeX version 6.7.136.
  • For anyone interested: I eventually fixed this by opening the Zotero sqlite database in a database editor and replacing all occurrences of 'Archived version' with 'archive_location'.
  • (that's probably a bad idea, FWIW -- manually editing the database in sqlite has the potential to break all sorts of things)
  • I realized that, and made a manual backup of the database to be sure.
    I would still be interested in suggestions for other solutions!
Sign In or Register to comment.