Argument goes to the top

You want to copy data from the open document to the created document, but the path to the open document is not fixed, so you need to pass in the parameter

The code example is as follows:

var dataUrl = Argument["dataUrl"];
builder.OpenFile(dataUrl);
var oDocument = Api.GetDocument();
GlobalVariable["CommentsReport"] = oDocument.GetElement(0).GetText();
builder.CloseFile();

builder.CreateFile("docx");
var oCommentsReport = GlobalVariable["CommentsReport"];

var oDocument = Api.GetDocument();
var oParagraph = oDocument.GetElement(0);
oParagraph.AddText("Data from DOC file: " + oCommentsReport);

builder.SaveFile("docx", "GetCommentsReport.docx");
builder.CloseFile();

Called through the docbuilder interface

{
    "async": false,
    "url": "https://example.com/getCommentsReport.docbuilder",
    "argument": {
        "dataUrl": "https://example.com/dataFormData.docx"
    }
}

After running, an error is reported:

{
    "key": "bld_f8e610a8d71f26e5",
    "urls": {},
    "end": true
}

Help with that. Thank you so much

Hello @css,
Unfortunately, at the moment builder.OpenFile and builder.CreateFile methods don’t support arguments. It will be fixed in one of the future versions. Sorry for the inconvenience.

How does generating documentation solve the problem of parameter passing? How to pass parameters with large amount of parameter data?

Arguments are supported by other Document Builder methods, only OpenFile and CreateFile don’t support them. I’m afraid we can’t offer any workaround.

What parameters are supported by other document builder methods? How to solve the data transfer to the document? Please reply as soon as possible. Thank you