Custom date meta field shows blank data on compile

I am on Mac Scrivener 3.1.2. I love the additional custom meta field types (lists, checkbox, etc) but discovered a problem when I tried to compile a draft with the date field inserted beneath the scene title. Nothing appeared. If I use other custom meta fields, they are inserted correctly into the compiled output. I’ve tried changing the date format of the field from a custom format to one of the defaults but that didn’t help. If I output all the custom meta information by choosing the checkbox labeled “metadata” under Section layouts when editing the layout in the compile settings, then all the fields are included in the compiled version. But I only need the date/time meta for this draft.

Date and time example from inspector
Screenshot 2019-06-05 16.30.59.png

Example of putting meta into scene title. The correct information is outputted for “Who” but not for DateAndTime
Screenshot 2019-06-05 16.31.35.png

Selecting all meta data in settings which works but is overkill. I only want one field output, not everything.

Is this a known problem? Is there a fix?

It certainly looks like you have everything typed in correctly from the screenshots, so I am as puzzled as you are by the behaviour—especially since you confirmed the metadata is properly assigned to these items, by testing with the full Metadata checkbox (a common problem is putting the metadata in the wrong place, like the folder and expecting a child item to print it).

The only things I can think to try are a few additional tests:

  • Copy and paste the Title Suffix into one or two of the text files themselves, in the main content area. Does it work when placed there?
  • If not, try copying and pasting the metadata field name from Project Settings—I don’t see any obvious problems with it, but maybe the actual field name has a zero-width Unicode character or something in it. If that works, then try retyping the field in completely with ⌘A, delete and then see if the compile settings work.

I’ve solved the problem. When I changed the name of the date field from “DateAndTime” to “When” the date appeared in the compiled output. Apparently having Date as part of the field name conflicted with internal variable names in Scrivener (that’s my guess at least).

The suggestions made were good and things I tried. I have a test project just to test complie settings and on the test project (not the novel I’m writing) I discovered I inserted the <$custom:field> code into the wrong section by doing those things. Everything is now working in both my test project and the project I care about. Thanks.