Extra Variables Documentation

edited January 21, 2025
I have found the [Citing Fields from Extra](https://www.zotero.org/support/kb/item_types_and_fields) page in the Zotero documentation, but I was wondering if there was a resource indicating which variables will work with which item type. I rarely get the output I need, and would love a guide to help me figure it out (As it comes up a lot).

For example, I have a historical document. Based on its type and citation data, I'm using the 'Manuscript' as the item type. My citation style is Chicago (Full Note).

Attempt 1: placed 'type: periodical'; 'volume: 1'; and 'issue: 9' in the extra field (each on its own row). None of the extra data was returned.

Attempt 2: removed 'type: periodical', and left 'volume: 1'; and 'issue: 9' in the extra field. Volume returned, issue did not.

Attempt 3: changed to 'book' item type, placed 'type: periodical'; 'volume: 1'; and 'issue: 9' in the extra field (each on its own row). None of the extra data was returned.

Attempt 4: still book type, removed 'type: periodical' left 'volume: 1' and and 'issue: 9' in the extra field. None of the extra data was returned.

Attempt 5: still book type, removed 'type: periodical', placed 1 in the 'volume' field, left issue: 9 in extra. Volume returned, issue did not.

There are also other fields in the linked list that would be really useful to show in citation data, but they rarely work for me. Some kind of mapping guide would be handy.

I didn't want to use book for this (the icons serve as a visual cure for me) but tried it anyway and it didn't work. I don't want to have to use report as that seems to be a catch-all and I really need to clean it up and get out of the habit of using it for things vastly different to reports.
  • It sounds difficult, whether or not the Extra field will actually be used will mostly depend on the style (I think).
  • Yes, that's correct.

    I would recommend that you tell us what you want to achieve in each individual case and we can give guidance or adapt the necessary citation style with/for you.
  • Thanks, I was hoping to avoid having to do that. I'd rather have the information so I can adjust as I go.

    I'm using Chicago 17th Edition. Is there any documentation on this?
  • The Extra field can hold any valid CSL variable and which variable is used for which item type and how depends entirely on the citation style, so you'd have to read the style's CSL code to follow that (we certainly can't document that individually for every one of >1,000 different styles).

    So we can help you with specific questions and we might be able to help you get CMoS 17 to do what you need, but I'm afraid the type of documentation you appear to have in mind is just not possible given how CSL works, sorry.
  • All good, If this comes up again I'll see if I can make sense of the CSL code in the first instance and then post here if I can't figure it out.

    Regarding the example in my original post, would you know how I could set up the item to achieve the desired output? It needs to have title, author, place, date, archive, vol, number/issue.

    My citation style is Chicago (Full Note).
  • That'd take quite a bit of moving things around, because Chicago is only to a very limited degree organized around item types and more about systematics of information (and volume/issue would never be in the end of the citation in regular Chicago style).
    You're wedded to using those variables? E.g. using dedicated variables for archival information, such as archive_collection and archive_location (I'm assuming that's what vol and number are) isn't an option? That'd make things much easier.
  • Archive was more the name of the repository that the historical document is kept in. The issue I'm encountering is that I can't get the extra field to return what I need.

    It's not optimal to have to manage so much in the extra fields, but if that's what I need to do so be it.
  • edited 3 days ago
    @sicahjes
    I'm not a programmer, but AFAIK you expect Extra field will do some magic. In your initial post, you gave some examples, like e.g: 'type: periodical' when using Manuscript type. IMHO this cannot work.

    Extra field may be used ALSO for storing custom variables / values pairs. As you enter content there manually (however, from my little experience, some sources added via browser Connector also stores some info there), you have to be careful how you name your variables you want to use later in CSL. There are a list of standard variables here: https://docs.citationstyles.org/en/stable/specification.html#appendix-iv-variables which you cannot - or shouldn't - use to avoid conflicts (I suppose). Also, you cannot use standard source type names to avoid conflict within Zotero itself (again, I suppose).

    ---------------
    IMO somewhere there at Zotero site SHOULD BE a manual describing what can be put in Zotero Extra field as a variable, and how to use it later in CSL (with examples!). Also - which are forbidden / can interfere badly with Zotero.
    ---------------

    If any Zotero developer (or experienced user) reading this, please correct me.
    I'm new to Zotero, using it for a few days;-)


  • Thanks TomassoTomassini,

    Your comment "I'm not a programmer, but AFAIK you expect Extra field will do some magic. In your initial post, you gave some examples, like e.g: 'type: periodical' when using Manuscript type. IMHO this cannot work" illustrates the underlying purpose of my post: to understand how the Extra field works.

    Regarding the manuscript type, I used this based on comments I read elsewhere in this forum. For example, in a post discussing citing entire periodicals, the follow exchange occurred in response:

    A: CSL has a 'periodical' item type that could mark whole journal issues and allow citing them: enter as type: Periodical in Extra.
    Q: what actual Item Type should be used to populate the fields, if using the Periodical option in Extra?
    A: doesn't matter, whatever works for you. The Extra field overrides the item type under the hood.

    https://forums.zotero.org/discussion/111485/full-journal-issue

    I had read the guide on the extra fields, and it provides a list of variables that can be used in that field. Through trial an error, I discovered that there may be some exceptions (likely based on the citation style) making this contingent on the item type - which is why I asked if "there was a resource indicating which variables will work with which item type."
  • @sicahjes
    Could you please put here a link to the guide on the extra fields?

    What I wrote above is based on my little Zotero experience and general approach to avoid non standard solutions as much as possible. Even if they work, there are ALWAYS some exeptions - exactly as you wrote.

    Additionally, I really would like to know how overwriting standard key/value pairs works. For example:
    1. If we can set there different "type", Extra field have to be parsed at the beggining, as the first field. Then, some unclear things are happening "under the hood", like e.g. after changing "type", some form fields belonging to initialy chosen one may not work, and some other variables become available.
    2. Regardless of what happens then inside the Zotero and how it really works, I suppose we should modify CSL
    3. If we encounter exceptions, no. 1 above is not always true:-( which may lead to much more complicated CSL, which means we (end users), should know how it works, and why sometimes something is not working.

    Zotero developers, please join this conversation;-)
  • The documentation is here: https://www.zotero.org/support/kb/item_types_and_fields#citing_fields_from_extra to be read together with the CSL specifications https://docs.citationstyles.org/en/stable/specification.html which define the CSL standard and the existing mappings of Zotero to CSL as e.g. here: https://pobrien333.github.io/zot2csl/

    With the exception of "type" and any date variables, you shouldn't use Extra to specifiy already existing variables for a Zotero item (I believe they'll just get merged back into the existing field on Sync, but haven't tested for a while).

    CSL doesn't have a concept of certain variables not 'working' for any type, so that consideration is irrelevant.

    They key reason something isn't working as _you_ expect it would be in the CSL style you used. For example, there is not particular reason to think that any given CSL style should display a specific variable for a specific item type (which was the original issue here). Since every CSL style can define the behavior of every item type separately, there is, as I say above, no way to provide some sort of list/documentation for this in general.

    Beyond this, we're happy to try to answer specific questions, but it's ime generally not a good use of time to try to discuss this in the abstract before someone has worked with this enough to be able to formulate questions about specific issues.
  • To summarize this up:
    1.
    Modifying CSL, you can use any Zotero variable in any "type".

    2.
    Key/Value specified in Extra field can overwrite only "Type" value and any date values.

    3.
    Full consequences of overwriting "Type" are still unknown (something can work, someting not).

    4.
    Using Extra field, you cannot enter there any predefined Zotero variables, which come from Zotero interface after chosing initial "Type" (Extra values will be ignored).

    Assumption:
    We can define our own unique variable in CSL, and put it in Extra field - is that correct?

    Suggestion for Zotero guys:
    Add validation for Extra field, to avoid entering there Zotero variables, assigned to initially chosen Type, or used by Zotero itself in any way (to avoid repeating again and again questions "why it's not working").

    Correct me if I'm wrong, please.

    And many thanks to anyone writing here - this may help future generations:-)
  • It really, really is much better to ask specific questions than to try to get at this abstractly. The language above isn't super precise so a lot of these I honestly don't know if they're correct.
  • "Assumption:
    We can define our own unique variable in CSL, and put it in Extra field - is that correct? "

    No, you can't just invent new variables.
Sign In or Register to comment.