Creating dynamic / programatic documents from a Zoho Flow workflow

Creating dynamic / programatic documents from a Zoho Flow workflow

I would like to use Zoho Flow and Writer templates to create highly programmatic Writer documents.  

The desired process would be as follows:

The user fills out a Zoho Survey or Zoho Form which is used as the trigger for a Zoho Flow. 

Zoho Flow then uses Deluge functions to create additional calculated fields of text (for example, if the user selected a specific set of options, then the field "Technical_Recommendation_01" would be set to a short paragraph of pre-defined text.  If using Zoho Survey, some of this calculated would be done within the survey itself, on hidden fields.

Once the fields have been set, I wish to merge those into a Writer template.  This document would be then be emailed to the recipient as a PDF or Word document.

I can see that you can access a Writer template in Flow, but I cannot figure out how to define the fields I will be pushing to the template in Writer.  I'm happy to push data into a Zoho Spreadsheet first, but I'm still stuck on how to add the fields into the template in Writer.

Best regards,
Joe