Document Server version:7.4
Type of installation of the Document Server (docker, deb/rpm, exe)
OS:docker
for example,I want get “hello world” ,use “connector ”,
so please tell me what should i do ,thanks
like this examples ,ONLYOFFICE Api Documentation - GetAllContentControls ,I can use plugin get contentControl of value,but I can not get contentControl of value by connector。In this example, “text” is the value of the contentControl, but it cannot be obtained through the connector
Hello, thank you for your question. To use the connector to get “hello world” in a document, you need to follow these steps:
- Install the connector for your service (e.g. Nextcloud, Confluence, HumHub, etc.) from the official sources¹³⁴⁵.
- Connect ONLYOFFICE Docs to your service using the connector settings¹.
- Open a document in ONLYOFFICE Docs from your service and create a connector object using the
docEditor.createConnector()
method². - Use the
connector.callCommand()
method to send a command that will insert “hello world” into the document using ONLYOFFICE Document Builder syntax². For example:
connector.callCommand(function() {
var oDocument = Api.GetDocument();
var oParagraph = Api.CreateParagraph();
oParagraph.AddText("Hello world");
oDocument.InsertContent([oParagraph]);
});
- Save and close the document.
I hope this helps. If you have any further questions, please feel free to contact us at support@onlyoffice.com. Have a nice day!
ok,thank you