I'm thinking it would be done by putting something in the parenthesis in this code:
var myDocument = app.documents.add();
but I don't know what.
Something like this:
var myTemplate = "/C/template_file.indt",
myDoc = app.open(File(myTemplate));
Where myTemplate is an indesign template file (notice the *.indt extension) saved on your C drive
Retrieving data ...