I’m working on a Google Apps Script extension for Google Docs that stores information using Document Properties. My extension needs to handle document rollbacks through Google’s version system.
I’m wondering about how Properties behave with versions. When I create a new version of my document, does it preserve the Properties data that existed at that time? Or do Properties always show the latest values regardless of which version I’m viewing?
This is important for my add-on because I need to know if rolling back to an older version will also restore the Properties data from that point in time, or if I’ll always get the current Properties regardless of the document version I’m looking at.
yeah, i found out the hard way too. properties just show the latest values, so if u need past data, u gotta handle that somehow in the doc itself. otherwise, rollback won’t help with properties.
Properties data is not version-controlled in Google Docs, which means they remain static regardless of which document version you’re viewing. I ran into this exact issue when building a workflow tracking add-on. The Properties always reflect the most recent state, not the historical state from when that version was created. For your use case, you’ll need to implement your own versioning system by storing timestamped data within the Properties themselves or embedding critical state information directly in the document content. I ended up creating a JSON structure in the Properties that tracked changes with timestamps, allowing me to reconstruct historical states when needed.
Google Docs Properties are essentially global metadata that persist independently of document versions. When you roll back to an earlier version, the document content reverts but Properties maintain their current values. I discovered this limitation while developing a document approval system where I needed to track approval states. The workaround I implemented was storing version-specific data as hidden text within the document itself using custom formatting or comments, rather than relying on Properties for historical data. This approach ensures that when you revert to a previous version, the associated metadata travels with it. You might also consider using a separate spreadsheet as a data store if your extension requires robust historical tracking capabilities.