Add Custom Document Properties via Plugin

How can I add a custom property (like “Modified Date”) to a document using an ONLYOFFICE plugin?
image

Hello @subbu

Please provide more details about the usage scenario and about custom properties in general. What is the screenshot referencing?

Hello @Constantine

There are multiple use cases. One of the use case is to embed compliance-related metadata such as RegulationCode, ApprovalStatus, or ReviewerName.

Another use case would be include fiscal year, report type, and auditor details in financial documents.

manual entry is error-prone and inefficient. Hence we are looking for a solution to update the custom document properties programmatically.

Are these custom properties defined as simple text for the placeholders? It is not clear what they are in the document as object. Can you provide a bit more detailed description of them? Where are they used in the document?

@Constantine
It will be simple text like who created the document, who reviewed it. File number, date/time like that

Thank you for the screenshot, now I see. Let me verify the possibility to add these properties, I will share an update once I get any information.

1 Like

I was informed that in upcoming version 9.0 of Docs and Desktop Editors new ApiCustomProperties class and methods for it will be added. Some of the examples are below:

ApiCustomProperties.prototype.AddStringProperty = function (sName, sValue)
ApiCustomProperties.prototype.AddNumberProperty = function (sName, nValue)
ApiCustomProperties.prototype.AddDateProperty = function (sName, oValue)
ApiCustomProperties.prototype.AddBoolProperty = function (sName, bValue)
ApiCustomProperties.prototype.GetPropertyValueByName = function (sName)

They will be also added into documentation after the release. ETA is end of this month.

1 Like