Skip to main content
Version: 1.x.x

Record

A quip.apps.Record object is the basic unit of data storage in our API and represents a discrete unit of data within an app instance. By default, an app instance is created with a single quip.apps.RootRecord (which is just a special subclass of quip.apps.Record). The app may create additional quip.apps.Record instances to store discrete pieces of data that can be synced independently and can represent specific components within the app, such as a rich text box, an image, etc.

quip.apps.Record objects can store custom data for the app in the form of properties. Property data types can be any one of the following:

  • a Javascript primitive (string, number, boolean, etc)
  • a Javascript object or array that contains only primitives
  • a quip.apps.Record subclass
  • a list of Record objects in the form of a quip.apps.RecordList.

Record objects can be thought of as being analogous to JSON objects, with the primary difference being that defining a Record allows the developer to a) get independent syncing/merge behavior, b) add validation for their property data types and c) make use of our special data types, like quip.apps.RichTextRecord and quip.apps.ImageRecord.

Every Record or RecordList object is “owned” by another Record, in a hierarchical structure starting from the root. The developer does not need to explicitly specify these parent-child relationships; they are implicit upon creation of a Record or RecordList as a property of another Record.

note

Data that’s stored in the properties of quip.apps.Record objects is kept in the document that contains a live app. This means that a copy of the document contains a copy of your live app and its underlying data. To store preference data specific to a user viewing a document, you can use Preferences.