I’m working on a Google Apps Script extension for Google Docs that stores custom data using the document properties feature. My extension needs to handle document rollbacks through the version history system.
I’m wondering about how document properties behave when creating and restoring versions. When I create a new version of the document, does it preserve the current state of the document properties at that point in time? Or do document properties always reflect the latest values regardless of which version I’m viewing?
This is important for my add-on because I need to ensure data consistency when users revert to older document versions. If properties don’t get saved with versions, I’ll need to find an alternative approach for storing version-specific metadata.
Has anyone tested this behavior or knows how Google handles properties in relation to document versioning?
Nope, document properties don’t sync with version history in Google Docs. I found this out the hard way while building a collaborative workflow tool that stored metadata through properties. When users restored old versions, the document content rolled back fine, but all the custom properties stayed at their latest values. Total data nightmare. Properties basically run on a separate layer that ignores the versioning system completely. My workaround? I started embedding JSON metadata directly in the document header using invisible text with custom styling, then parsing it with code. Works great since the metadata becomes actual document content that Google tracks in version history.
Google Docs doesn’t store document properties with version history - learned this the hard way building a similar add-on last year. The properties service always keeps current values no matter which version you’re looking at or restore to. Revert to an older version? Only the content rolls back. Your custom properties stay at their newest values, which creates exactly those consistency problems you’re worried about. I ended up using invisible bookmarks with encoded data for version-specific metadata. You can insert these programmatically and they stick with document versions since they’re technically content. You could also try storing metadata in hidden text elements with specific styling, but bookmarks worked better for me.
Same issue here with my document tracker. Properties aren’t versioned at all - they’re global across the entire doc no matter which version you’re looking at. Really frustrating! I ended up using footnotes with hidden metadata instead since those actually stick with each version. It’s a bit of a hack but it works consistently.