I'm having trouble, replacing text in a Google Doc, using App Script.
Inside the document I have certain text like {{Date of birth (dd/mm/yyyy)}}. I need to replace it with user entered values from Google Form. I am getting the values from Google Form properly but few replacement pattern e.g {{Date of birth (dd/mm/yyyy)}} not getting replaced. Other replacement characters like {{Name}} , {{Email}} working properly. Here is my part of the replacement script as follows:
if(this.sheetColumns.length){
for(var k=0; k < this.sheetColumns.length; k++){
docValues.replaceText(Utilities.formatString('\\{\\{(%s)\\}\\}', escape(this.sheetColumns[k])), this.formObj.namedValues[this.sheetColumns[k].trim()]);
}
}
Any help will be appreciated.