SetFormsData

function SetFormsData(arrData: FormData[] = null): void

Description

Sets the data to the specified forms.

Parameters

arrDataFormData[]default: null

An array of form data to set to the specified forms.

Returns

void

Try It

var oDocument = Api.GetDocument();
var oParagraph1 = oDocument.GetElement(0);
var oCheckBox = Api.CreateCheckBoxForm({key: "BestCompany"});
oParagraph1.Push(oCheckBox);
var oTextForm = Api.CreateTextForm({key: "CompanyName"});
oParagraph1.Push(oTextForm);

oDocument.SetFormsData([
   {key: "BestCompany", value: true},
   {key: "CompanyName", value: "OnlyOffice"}
]);

Get Help

  • If you have any questions about ONLYOFFICE Docs, try the FAQ section first.
  • You can request a feature or report a bug by posting an issue on GitHub.
  • You can also ask our developers on ONLYOFFICE forum (registration required).