Merge API Issu

Hi,

I am using Merge API to merge the document using merge strings. I used {{#foreach
myList}}…{{/foreach myList}} to create/merge row data for my table in the document. When myList is empty my table rows show the merge strings as it is instead of showing blank row.
Can you please suggest a way to put a check on myList in the template file and if it is empty just show a blank row for it else display the merged data in the row.

Attached is the template file I used for merging.

Hi Preeti,

Thanks for your inquiry. Please use cleanup parameter while using mail merge. Please check this parameter detail from here:
https://docs.aspose.cloud/words/mail-merge/

Moreover, please check the code example shared in following documentation link. Hope this helps you.
https://docs.aspose.cloud/words/mail-merge/