Skip to main content
This rule allows you to generate a document for each row in a Repeating table question. To use the rule, you need to deploy it from the Add-ons section of FlowForma settings. FlowForma settings Add-ons section Deploy the rule from Add-ons You’ll now see the rule in the Communications section of the Add rule panel in the Flow Designer. Rule in the Communications section of the Add rule panel

Title

The first part of the business rule lets you define a title for your rule and select the event on which it operates. The default title is the standard FlowForma rule name; change it by deleting the text and entering your own. In the event field you determine when the rule is executed. For a flow this can occur when the form is loaded, started, or completed. For a step this can occur when the step is started, saved, or completed. For questions it can occur when the question is updated.

Rule condition(s)

The second part of the business rule lets you set conditions. These are not required, but if entered they control when the rule is executed in relation to other items in the form.

Rule actions

  • Document template: contains a drop-down list of all the document templates attached to the current flow.
    • To attach a document to a flow, you can either:
      • Edit the properties of a document in the “Document Templates” library and select the flow for that template.
      • Add and edit a new document template using this rule.
        • To add a new document, click the + icon beside the pen as highlighted below. Enter the title of the new document, then click the check icon to create the new template. Then click the pencil icon beside the template name to open the template and edit it. The new template is available to view in Document Templates. Once you’re finished editing, save the document.
        • You can also edit existing document templates associated with the flow you’re working on from the Generate Document rule:
          • Select the document template from the drop-down menu under rule actions. Click the pencil icon beside the template name to open the template, then edit the text and tokens. Click save to save your edits.
  • SharePoint folder: by default, the newly created document is saved in the form folder in the “Form Documents” library. This field gives you the option to define a different SharePoint folder for saving documents.

Available Tokens

The Available Tokens let you specify a folder structure, including sub-folders, for storing documents. By default the Form Documents library is used, and as documents are generated they’re placed into a sub-folder for each Form Title. However, you may want to create a sub-folder in the Form Documents library for each flow, so that when you open the Form Documents library you see a folder for each flow (provided a document generation rule has executed and created that folder). You can create further sub-folders using, for example, the Step Title token, so that when you open the Form Documents library, open the relevant Flow Title folder, then open the relevant Step Title folder, all documents generated by that step, in that flow, are stored there. A few examples: Subfolder for Flow Title - https://sitename.com/sites/FlowFormaSite/FormDocuments/{FlowTitle} Subfolder for Step Title - https://sitename.com/sites/FlowFormaSite/FormDocuments/{StepTitle} Subfolder for both Flow Title, and Step Title - https://sitename.com/sites/FlowFormaSite/FormDocuments/{FlowTitle}/{StepTitle}
  • Repeating table: this drop-down list shows all the repeating tables contained in the flow. Select the repeating table you want to use when generating multiple reports.
  • Output: you can return the document that was generated for a row by selecting a file upload question in the repeating table and setting it as the output.
  • Row Approval Question: you can use a Yes/No question to select which rows should have a document generated.
  • Convert to PDF: if this option isn’t checked, the document is created as a Microsoft Word file. If you check this option, the document is created as a PDF.
  • PDF security: available when Convert to PDF is checked. Check it to password-protect the generated PDFs with a User password and Owner password and control the Permissions applied (for example Content copying, Modify contents, Fill in, and Printing). This works the same way as in the Generate document rule.
  • Attach to step: check this box if you want to access the newly created document directly from the form, without having to go to the SharePoint library where the document was saved. To use this option, you also have to check the “enable attachments” option at the step definition level. A link to the document is included on the form.
  • Document suffix: by default, the name of the created document is “form+form ID”. The form ID is a number incremented from 1 from the moment the site was created. If you specify a suffix, it’s added after the form ID, so the document name becomes “form+formID+suffix”.
  • Stop execution: if stop execution is enabled and this rule is executed, no other rules are executed.
  • Enabled: rules aren’t saved to a list like questions and steps are, so if you want to stop a rule executing without deleting it, toggle this option to enable or disable the rule.
  • Enable audit: if checked, a record is added to the audit trail when this rule is executed. This option is available when the Compliance feature pack is activated.

Adding the business rule

Create a document from within the rule

Click the + icon next to the Document template drop-down, and enter the name of the document you want to create. Enter the name of the new document Click check icon to create the document. New document template created The template is now displayed with the pencil icon icon next to it. Click this to edit the document.
To edit the document, you need to install the FlowForma Word Plugin on your device.
Your document now opens in Word, with the FLOWFORMA option available in the ribbon. FLOWFORMA option in the Word ribbon Click FLOWFORMA, then click the Panel icon and enter your credentials. Enter your credentials in the FlowForma panel A panel is now displayed on the right containing flow properties and the steps and questions contained in your flow. Panel showing flow properties, steps and questions Right-click on the sub questions below the repeating table you’re using to generate your reports. Right click on the repeating table sub questions Click on the document where you want to place the item and select either Repeating Table or Repeating Section, and they’ll be added to the document. Repeating Table or Repeating Section added to the document Save your document.

Select the folder where you want your documents saved

SharePoint folder field By default, they go to /sites/subsite/FlowForma/FormDocuments//. If you click browse button, a selector appears where you can select any document library you have permissions for. Document library selector

Select the repeating table you want to generate reports for

Open the Repeating table drop-down to display all the repeating table questions available on your flow. Repeating table drop-down

Other options

  • Convert to PDF - if you want to convert the Word document to a PDF document, check the box.
  • Attach to step - if you want to attach the document in the attachments section at the foot of a step in the form, check this checkbox.
  • Document suffix - by default, the name of the created document is .extension. You can add a suffix so the document name becomes .extension.
Example This is a simple form with two standard questions and one repeating table question with 3 sub questions. Below is the form before the step has been submitted. Form before the step has been submitted Below is the form after the step has been submitted and the Multiple document generation business rule has executed. Form after submission with generated documents There are two documents attached to the step, one for each row of the repeating table. The first document is displayed below. First generated document The second document is displayed here. Second generated document As you can see, the standard text, along with any text or images you’ve added to the document, is displayed on every document. Only the data from a single row of the repeating table is included in the repeating table or repeating section on each document.