Free Support Forum -

How to add the records in table using Node.js SDK of Aspose.Words API

I am using node js and i want to add some records (rows value) into table. but i am unable to find the property/parameter which i need to pass for insert the record.

I am able to create the table by using following api “!/Tables/InsertTable”. its only created blank table with some specific row and column,

But i am unable to find the api for insert the record for the table.

Can you please send me the api for insert the record into table?


You can add data to each cell using PutParagraph API as following.

const fileName = "TestTable.docx";
const destFileName = "TestTable_updated.docx";

var request = new PutParagraphRequest(); = fileName;
request.folder = "";
request.paragraph =  new ParagraphInsert ({ text: "This is a new paragraph for your document" });
request.nodePath = "sections/0/tables/0/rows/0/cells/0";

wordsApi.putParagraph(request).then((result) => {    
}).catch(function(err) {
    // Deal with an error

Furthermore, following directory contains the Unit Tests (examples) of each Node.js SDK API:

Please note, the Unit Tests are grouped by the type of action over the document. Action could be one of two types: we can somehow change document elements, e.g. bookmarks, fields etc. or we can make some document actions e.g. convert, mailmerge and so on.