GetFormsData
function GetFormsData(): FormData[]
Description
Returns the data from all forms present in the current document. If a form was created and not assigned to any part of the document, it won't appear in this list.
Returns
FormData[]
Try It
var oDocument = Api.GetDocument();
var oParagraph1 = oDocument.GetElement(0);
var oCheckBox = Api.CreateCheckBoxForm({key: "BestCompany"});
oCheckBox.SetChecked(true);
oParagraph1.Push(oCheckBox);
var oTextForm = Api.CreateTextForm({key: "CompanyName"});
oTextForm.SetText("OnlyOffice");
oParagraph1.Push(oTextForm);
var sText = JSON.stringify(oDocument.GetFormsData());
let oParagraph2 = Api.CreateParagraph();
oParagraph2.AddText(sText);
oDocument.Push(oParagraph2);