I’ve tried to use the new string replacement variable ${VALUE} along with an environment variable that I’ve defined ${KICAD_USER_DATASHEET_DIR} and it does not expand to the expected path.
The value field for the symbol is the symbol is TI-BQ25171
I tried setting the symbol for the datasheet field like this… ${KICAD_USER_DATASHEET_DIR}/${VALUE}/${VALUE}.pdf
Strangely, it did not expand to… ${KICAD_USER_DATASHEET_DIR}/TI-BQ25171/TI-BQ25171.pdf
(which works when I don’t use ${VALUE})
Is there some sort of limitation on how many string replacements can be used?
For reference, here is my complete metadata for the symbol…
It won’t work in the Symbol Editor. (I’m not sure whether or not we evaluate environment variables in the symbol editor, but we definitely don’t evaluate text variables.)
Only when using the string-literal does the datasheet open as expected. When the ‘Datasheet’ field contains ${VALUE} as in the screenshot above, the datasheet does not open, a file-picker dialog is shown instead.
From this, it seems that string replacements are applied properly for the Schematic Editor canvas, but not for the Schematic Editor’s “Show Datasheet” function.