Pawli
Pawli

Reputation: 11

google apps script open new document

hi want to create a google document and add to the value of the variable which is. Why can't I pass it to a document with this function?

var doc=DocumentApp.create("Wynik"); 
doc.getBody().appendParagraph(arr[wasitfound]);

error code: "Exception: The parameters (number[]) don't match the method signature for DocumentApp.Body.appendParagraph."

Upvotes: 1

Views: 111

Answers (1)

Marios
Marios

Reputation: 27380

Check the documentation for appendParagraph.

It accepts a string but you are passing an array.

Example:

var str = "Hello";
doc.getBody().appendParagraph(str)

or use join:

doc.getBody().appendParagraph(arr[wasitfound].join())

Upvotes: 0

Related Questions