Can I use this?

The new meta fields outlined in this article are available since v5.39.0.

Introduction
anchor

Apart from the fields that are defined in a content model by the user, all content entries also have a set of date/time and identity-related meta fields. A couple of examples:

  • revisionCreatedOn - the date/time when an entry revision was created
  • revisionFirstPublishedOn - the date/time when an entry revision was first published
  • createdOn - the date/time when an entry was created
  • lastPublishedOn - the date/time when an entry was last published

These meta fields are automatically populated by the system, and they can be used to display information about the entry, such as when it was created, modified, or published, and by whom.

Developers can use these fields when querying entries, for example via the Headless CMS GraphQL API:

They can also use them in their custom JavaScript (TypeScript) code, for example, when hooking onto lifecycle events:

Revision-Level and Entry-Level Meta Fields
anchor

The meta fields are available at two levels: revision-level and entry-level.

Revision-level fields include the revision prefix in their names, and they contain information about the revision of an entry. For example, revisionCreatedOn is the date/time when the revision was created, and revisionCreatedBy is the identity of the user who created the revision.

On the other hand, entry-level fields do not contain the revision prefix in their names, and they contain information about the entry itself. For example, createdOn is the date/time when the entry was created, and createdBy is the identity of the user who created the entry. These fields do not change when a revision is created, modified, or published, nor if new revisions are created, modified, or published.

Meta Fields
anchor

The following table lists all the date/time and identity-related meta fields that are available for content entries.

Revision-Level Meta Fields
anchor

FieldDescription
revisionCreatedOnThe date/time when an entry revision was created.
revisionModifiedOnThe date/time when an entry revision was last modified.
revisionSavedOnThe date/time when an entry revision was last saved.
revisionFirstPublishedOnThe date/time when an entry revision was first published.
revisionLastPublishedOnThe date/time when an entry revision was last published.
revisionCreatedByThe user who created an entry revision.
revisionModifiedByThe user who last modified an entry revision.
revisionSavedByThe user who last saved an entry revision.
revisionFirstPublishedByThe user who first published an entry revision.
revisionLastPublishedByThe user who last published an entry revision.

Entry-Level Meta Fields
anchor

FieldDescription
createdOnThe date/time when an entry was created.
modifiedOnThe date/time when an entry was last modified.
savedOnThe date/time when an entry was last saved.
firstPublishedOnThe date/time when an entry was first published.
lastPublishedOnThe date/time when an entry was last published.
createdByThe user who created an entry.
modifiedByThe user who last modified an entry.
savedByThe user who last saved an entry.
firstPublishedByThe user who first published an entry.
lastPublishedByThe user who last published an entry.

FAQ
anchor

What Is the Difference BetweenmodifiedandsavedMeta Fields?
anchor

The difference between modified and saved meta fields is that modified fields can be null if the entry has not been modified yet, while saved is never null because it is updated even when the entry is created.

So, if we were to create a new entry, the createdOn and savedOn fields would have the same value, but the modifiedOn field would be null because the entry has not been modified yet. Only after the first update, the modifiedOn field would have a value different from null. Actually, after the first update, the savedOn and modifiedOn will always have the same value.