Is there a Google app script that lets me do a mail merge from a spreadsheet where the output is a single document…

Is there a Google app script that lets me do a mail merge from a spreadsheet where the output is a single document rather than separate documents (a new page for every row in the spreadsheet)?

AutoCrat works extremely well but it separates all the mail merges into different documents. I hope this question make sense.

81 Comments

  1. I haven’t seen one…but I have a similar request. I’d like to cycle through the Sheet and merge the rows that share a common cell value and email them in one message to an identified person. 

    OR an upgrade to Autocrat to merge an array into the doc.

    The closest may be sheetSpider. Create new Sheets based on an ID and share w/ the appropriate users.

  2. I haven’t seen one…but I have a similar request. I’d like to cycle through the Sheet and merge the rows that share a common cell value and email them in one message to an identified person. 

    OR an upgrade to Autocrat to merge an array into the doc.

    The closest may be sheetSpider. Create new Sheets based on an ID and share w/ the appropriate users.

  3. I haven’t seen one…but I have a similar request. I’d like to cycle through the Sheet and merge the rows that share a common cell value and email them in one message to an identified person. 

    OR an upgrade to Autocrat to merge an array into the doc.

    The closest may be sheetSpider. Create new Sheets based on an ID and share w/ the appropriate users.

  4. I think that docAppender only works onFormSubmit. I couldn’t get it to work with existing data. I don’t think there’s a manual trigger for it…but Andrew Stillman might correct me on that. #featureRequest  

  5. I think that docAppender only works onFormSubmit. I couldn’t get it to work with existing data. I don’t think there’s a manual trigger for it…but Andrew Stillman might correct me on that. #featureRequest  

  6. I think that docAppender only works onFormSubmit. I couldn’t get it to work with existing data. I don’t think there’s a manual trigger for it…but Andrew Stillman might correct me on that. #featureRequest  

  7. Bjorn Behrendt I was definitely tempted to try this.  Probably wouldn’t be too difficult to modify the script to do this.   The issue is that the way the tags are found and replaced is a global operation, so the merge would have to occur in a temporary document and then the body of that document would have to be appended to the existing document.

  8. Bjorn Behrendt I was definitely tempted to try this.  Probably wouldn’t be too difficult to modify the script to do this.   The issue is that the way the tags are found and replaced is a global operation, so the merge would have to occur in a temporary document and then the body of that document would have to be appended to the existing document.

  9. Bjorn Behrendt I was definitely tempted to try this.  Probably wouldn’t be too difficult to modify the script to do this.   The issue is that the way the tags are found and replaced is a global operation, so the merge would have to occur in a temporary document and then the body of that document would have to be appended to the existing document.

  10. So currently the steps Autocrate takes?

    1. Create a copy of the template with tags

    2. Read line 1 from sheet

    3. replace tags

    4. Repeat 1-3 with next line

    It shouldn’t matter if you add 1 page at a time to the document since the tags from the previous line would already have been changed, thus leaving only one set of tags to change.

    Append steps

    1. Create a copy of the template with tags

    2. Read line 1 from sheet

    3. replace tags

    4. Append to doc created in step 1.

    5. Read next line

    6. Replace Tags

    7. Repeat 4-6

  11. So currently the steps Autocrate takes?

    1. Create a copy of the template with tags

    2. Read line 1 from sheet

    3. replace tags

    4. Repeat 1-3 with next line

    It shouldn’t matter if you add 1 page at a time to the document since the tags from the previous line would already have been changed, thus leaving only one set of tags to change.

    Append steps

    1. Create a copy of the template with tags

    2. Read line 1 from sheet

    3. replace tags

    4. Append to doc created in step 1.

    5. Read next line

    6. Replace Tags

    7. Repeat 4-6

  12. So currently the steps Autocrate takes?

    1. Create a copy of the template with tags

    2. Read line 1 from sheet

    3. replace tags

    4. Repeat 1-3 with next line

    It shouldn’t matter if you add 1 page at a time to the document since the tags from the previous line would already have been changed, thus leaving only one set of tags to change.

    Append steps

    1. Create a copy of the template with tags

    2. Read line 1 from sheet

    3. replace tags

    4. Append to doc created in step 1.

    5. Read next line

    6. Replace Tags

    7. Repeat 4-6

  13. This shows an amazing amount of promise. I was trying to figure out a workaround involving IFTTT and FormMule. Not perfect with formatting, but it does create a single document. I’m more interested in the solution you have laid out however.

  14. This shows an amazing amount of promise. I was trying to figure out a workaround involving IFTTT and FormMule. Not perfect with formatting, but it does create a single document. I’m more interested in the solution you have laid out however.

  15. This shows an amazing amount of promise. I was trying to figure out a workaround involving IFTTT and FormMule. Not perfect with formatting, but it does create a single document. I’m more interested in the solution you have laid out however.

  16. Looking at it again, it seems I did consider spaces and I tested with a space in the column heading and in the rows of data, both seem to be handled ok. Can you share your Sheet?

    As for the cursor position – it was really easy to update that so you can add “tags” wherever your cursor is.

  17. Looking at it again, it seems I did consider spaces and I tested with a space in the column heading and in the rows of data, both seem to be handled ok. Can you share your Sheet?

    As for the cursor position – it was really easy to update that so you can add “tags” wherever your cursor is.

  18. Looking at it again, it seems I did consider spaces and I tested with a space in the column heading and in the rows of data, both seem to be handled ok. Can you share your Sheet?

    As for the cursor position – it was really easy to update that so you can add “tags” wherever your cursor is.

  19. Alright, I think I isolated it. It looks like tags with a question mark in them aren’t coming through correctly. I’m going to play around to see if I can figure out how to make them work, but I think that is the issue.

  20. Alright, I think I isolated it. It looks like tags with a question mark in them aren’t coming through correctly. I’m going to play around to see if I can figure out how to make them work, but I think that is the issue.

  21. Alright, I think I isolated it. It looks like tags with a question mark in them aren’t coming through correctly. I’m going to play around to see if I can figure out how to make them work, but I think that is the issue.

Leave a Reply