1. What is the issue? Please be detailed.
I was attempting to avoid creating extra entity fields, and thought I could access the metadata fields in my form, specifically __createdAt and __updatedAt. I put an instance lookup into a note to show when the selected item was created / last updated, but it shows as blank.
2. What steps can we take to reproduce this issue?
Put a lookup like this into a note instance('your_list')/root/item[name=${selected_item}]/__createdAt
3. What have you tried to fix the issue?
Tried in Enketo / Webforms / Collect.
Tried a standalone calculate field and displaying that field value in a note and also a lookup directly in a note.
Asked kapa.
Nothing errored, but there was no value ever shown.
That makes a lot of sense! We haven't exposed system fields other than the ID automatically because that could lead to a lot of extra data for contexts that don't need it. So for now you would indeed need to introduce your own explicit properties and calculations. If we do give a way to access the system properties in the future it would be via explicit opt-in.
There's no detectable difference between a node with a blank value or a non-existent node. In many cases that's great but in a case like this it's not very helpful for understanding what's going on.
Is there a place in the docs (or source) where we could see these metadata (“system fields”)? This could allow further discussion together which ones are relevant to access.
One other thing to note which @Matthew_White pointed out to me is that created at and updated at are when the entity was created or updated on the server. That could possibly be quite different from when it was actually captured. I think having your own custom properties based on client time probably is closer to what you want.
ahhh ok. yep, creating my own fields will avoid dates being wrong if uploaded later. (of course if I use start or finish and the form is started saved and left for a while, or started, mostly done, left for a while and then finished the same thing will happen)