- Copies your template workbook to a destination file.
- Writes the answers you have mapped into the input cells of that copy.
- Forces Excel to recalculate the whole workbook.
- Reads the output cells you have mapped and writes those values back into form questions.
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.Before you start
- Your FlowForma tenant must be configured for Azure AD app-only authentication. The rule uses it to drive Excel’s calculation engine. If it is not configured, the rule fails with a message saying so. Contact FlowForma support to have it enabled.
- The template workbook and the destination file must both be within the same site as the flow.
- The destination file must be in the site’s default document library (usually Documents or Shared Documents). Other libraries on the site are not supported.
- The workbook must be
.xlsx. Formulas must already be in the template: the rule does not add or edit formulas, it only sets values and reads results. - You need the step, question, and sub-question codes of every question you want to map. These are shown in the properties panel of the Flow Designer.
Rule actions
- Template file (required): the server-relative path of the workbook holding your formulas, including the file name and
.xlsxextension. This file is never modified. - Destination file (required): the server-relative path where the calculated copy is written, including the file name and
.xlsxextension. Any folders in the path that do not exist yet are created. - Overwrite existing destination file: checked by default. When checked, the destination file is replaced on every run. When cleared, the rule fails if a file already exists at that path, so use a token such as
{FormID}in the destination path to keep the name unique. - Input cell mappings: a JSON block that maps form answers into cells of the workbook. See Input cell mappings.
- Output cell mappings: a grid that maps cells of the recalculated workbook back into form questions. See Output cell mappings.
{FormID}, {StepID}, {FlowTitle}, {StepTitle}, {FormTitle}, {FlowFormaUrl}, {FlowFormaParentUrl}, {FlowFormaSiteCollectionRoot}, {QuestionCode}, and {StepCode|QuestionCode}.
The destination is always created fresh from the template before any values are written, so values from a previous run never carry over into the next one.
Cell addresses
Both mapping sections use the same cell address format: an optional worksheet name, an exclamation mark, then the cell reference, for exampleInput!B305.
- On a workbook with more than one worksheet, always include the worksheet name. A cell address with no worksheet name is ambiguous and the rule fails rather than guessing which sheet you meant.
- On a single-sheet workbook you can omit the worksheet name.
- Worksheet names in a cell address may contain letters, numbers, and spaces. A sheet whose name contains other characters cannot be targeted.
- Only single cells are supported, not ranges. Map each cell individually.
Input cell mappings
Enter a JSON object with aMappings array. Each entry writes one answer into one cell.
Click Validate & format JSON to check the block before saving. It reports invalid JSON, a missing or malformed cell address, a missing
Question, an unrecognised ValueType, and any step, question, or sub-question code that does not exist in the flow. When the block is valid it is reformatted and the number of mappings is confirmed. The same checks run when you save the rule, so a rule with an invalid mapping block cannot be saved.
Input mappings are typed by hand and do not use the question picker. Enter the codes as plain text exactly as shown above.
Reading rows from a repeating table
For a question inside a repeating table, addFilterQuestion, FilterValue, and RowIndex. The rows are filtered first, then RowIndex picks the Nth row from the filtered result. It is not an absolute position in the table.
Take a repeating table of investments with a Type column and a Value column:
This mapping writes the value of the second pension into
Input!B115:
Type = Pension gives table rows 1, 3, and 5. RowIndex of 2 selects the second of those, which is table row 3, so 5,000 is written to Input!B115.
To feed a whole block of the workbook, repeat the mapping once per row with an increasing RowIndex and cell, for example RowIndex 1 to 7 against Input!B114 to Input!B120.
If you omit RowIndex:
- With a
FilterQuestion, the first matching row is used. - Without a
FilterQuestion, and when the rule is triggered by a question inside the repeating table, the row being edited is used. Otherwise the first row is used.
Output cell mappings
Output mappings are entered as a grid rather than JSON. For each row:- Cell (required): the cell to read after recalculation, for example
L1 Ret1!H37. - Question (required): the question to write the result into, chosen with the question picker.
TRUE or FALSE is converted to Yes or No automatically, so you do not need a formula in the workbook to produce the text.
If a mapped output cell returns nothing, the target question is left unchanged.
Value types
ValueType tells the rule how to convert a form answer before writing it to Excel. It applies to input mappings only.
Use
string for a date only when the workbook treats it as text. Excel cannot calculate on a date written as text, so if the formulas do date arithmetic, add a question that produces the date as a number and map that as number instead.What happens when the rule fails
If the rule cannot complete, for example a Graph call fails or a cell address is invalid, then:- The output questions are left unchanged. On a calculator this looks the same as the numbers simply not moving, so do not treat unchanged outputs as a successful run with no change.
- The destination file copy is removed, so the presence of a destination file is not proof that the calculation ran.
- The error is recorded in the flow’s Failures list with the step, question, and rule name. Check there first when a calculation does not produce a result.
- The tenant is not configured for Azure AD app-only authentication.
- The template or destination path resolves outside the flow’s site.
- The destination file already exists and Overwrite existing destination file is cleared.
- A cell address has no worksheet prefix on a workbook with more than one worksheet.
- A cell address points at a sheet or cell that does not exist in the template.
- 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.
The Excel calculation rule needs network access and is supported on public forms.

