In some apps, it is important to track when and where some data was changed. For example, in a field service app, it may be important to record when a certain field was changed.
AppSheet has a simple mechanism to track changes-- via 'Change' column types. There are three "Change" column types-- ChangeTimestamp, ChangeCounter, and ChangeLocation. These column types all have a set of shared characteristics that are specified via the column's Type Qualifier:
- What triggers a change: any change to any other column, any change to some specific fields or a single field, or changes to a specific field that result in one of a known set of values
- What should happen when such a change is detected: increment a counter (ChangeCounter), set a timestamp to the current time (ChangeTimestamp), or record the current location (ChangeLocation)
As a simple example, in the Interview Feedback sample, the Feedback table has a Changes column of type ChangeColumn. The type qualifier doesn't "qualify" the type in any way, so this column will track changes to any other field in the row. If any other row changes, the value of the Changes column is incremented.
A more typical example would want to track changes to specific columns, perhaps even more specifically changes of those columns to specific values. In the Store Inventory sample, the Inventory List table has a Date Checked column. It listens for changes to a specific other column, Quantity In Stock. And in fact, it looks to see if that value changes to 0. If it does, then the column records the current timestamp.