Skip to content

Field notes

Log Entry Metadata: Which Custom Fields Are Worth Attaching

A log entry can carry more than a value and a date. Here is which extra fields earn their place, using Apple's HealthKit metadata as the model.

referencedataorganization
The Optimized Team· ProductUpdated Nov 17, 2026

Log entry metadata is the information that describes an entry rather than being the entry itself. The fields worth attaching are facts about the record: where it came from, whether a person typed it, which time zone it was made in, what range a lab judged it against, and which version of the entry this is. Interpretation, advice and conclusions do not belong there.

Apple's HealthKit is a handy model, because it spells out what a well-built record can carry. Every HealthKit object can hold a metadata dictionary, and the rules are short enough to borrow for any personal log.

What a metadata field is#

In HealthKit, the metadata dictionary contains extra information describing the object. The keys are strings. The values can be strings, numbers or dates. You set the metadata when you create the object, by passing it to the initializer.

Apple draws a line between two kinds of keys. Predefined keys exist so that different apps can share data and still agree on what a field means. Custom keys are there for what is specific to your own app, and Apple says developers are encouraged to create them as needed.

That line makes a good test for your own log. Before you add a custom field, ask whether you'll filter by it, audit by it or compare entries with it. If not, it's probably a note. Keep it in free text.

Two limits keep a metadata scheme honest:

  • Plain value types. A string, a number or a date. If a field needs a paragraph, it is not metadata.
  • Fixed at creation. The field describes the moment the entry was made. If it changes later, that is a new version of the entry, which is covered below.

Provenance: who entered it, when, and on what#

The first group of fields answers a question you will have months later: can I trust how this row got here?

HealthKit's predefined general keys include an identifier set by the source, the user's time zone when the object was created, and whether the sample was entered by the user. The user-entered key is simple: it is true if a person entered the sample, and false otherwise. The same page lists device keys for the device name, the manufacturer and the serial number of whatever took a reading.

A personal log can borrow all of these:

| Field | The question it answers | Example value | | --- | --- | --- | | Entered by hand | Did I type this, or did a device or import produce it? | true or false | | Time zone | What did the clock say where I was? | America/Chicago | | Source or device | Which scale, meter, app or person produced it? | bathroom scale, model name | | Original identifier | Which row in the source does this match? | a row number or code |

The time zone deserves a second look. A timestamp without a zone turns ambiguous the first time you travel and wrong the first time the clocks change. Storing the zone beside the time costs one short string per entry.

The source field pays off when two devices disagree. If you need a refresher on why the name matters, see what a device or app name tells you in a recorded entry.

Lab context: the range travels with the number#

Lab entries are where metadata earns its keep. HealthKit defines keys for whether a sample was taken in a lab and for the lower and upper limit of the reference range for a lab result.

The reason is practical. A number alone cannot be compared with a number from another lab, because labs can report different ranges for the same marker. If the range sits on the same row as the value, the row stays readable years later, even if you switched labs in between. The article on how to keep the reference range on every row goes through the layout.

Be clear about what this metadata doesn't do. It records the range the lab printed. It does not say whether a value is good or bad for you, and a log should not try to. Reading a result is a conversation for you and your clinician.

Identifiers and versions#

The least obvious fields are the ones that stop a log from filling up with copies.

HealthKit has a pair of sync keys. The sync identifier is a string that identifies a piece of data so it can be updated and synced. If you set it, you must also set the sync version. When you save an object whose identifier matches an existing one, the system compares versions. If the new version is greater, it replaces the old object.

You can copy the idea directly:

  1. Give every entry a stable identifier that never changes, such as a row key or an import code.
  2. Give it a version number that starts at 1.
  3. When you correct an entry, save it with the same identifier and a higher version, instead of adding a second row.

This matters most at the edges of your system. Imports, exports and syncing between devices are where duplicates come from, and where edits get lost. Two earlier pieces cover the failure modes: when sync quietly drops entries between devices and two sources recording the same thing. An identifier and a version make both easier to detect, because a duplicate is simply two rows that share an identifier.

What to record, and what to leave out#

A short, consistent set beats a long one. If you're building a log from scratch, a reasonable starting set is:

  • Source: the device, app or person that produced the value.
  • Entered by hand: true or false.
  • Time zone: the zone the entry was made in.
  • Reference range: low and high limits, for any lab row.
  • Identifier and version: a stable key and a number that goes up when you correct the row.

Leave out anything that is an opinion about the entry. A field called "looks good," "concerning" or "worked" is not metadata, it is a conclusion, and it will color how you read every row after it. If you want to remember context, put it in a plain note and keep it separate from the fields you filter on.

Apps like OptimizedTracker keep entries in this spirit: the value, the date and the unit are the entry, and everything that describes where it came from is attached to it, not mixed in.

Consistency matters more than completeness. A field you fill in on every row is worth more than five you fill in when you remember. Pick the set, write down what each field means, and use the same spelling every time.

Conclusion#

Metadata should make a record easier to audit, not harder to read. Attach facts about the entry: its source, how it was entered, its time zone, the range a lab used, and its identifier and version. Keep judgments out, keep the set small, and use the same fields on every row. Then a log you open a year from now will still tell you how each line got there.

Share

X / Twitter