- 20 Sep 2021
- 1 Minute to read
- Print
- DarkLight
Using a Flow to Source a Report
- Updated on 20 Sep 2021
- 1 Minute to read
- Print
- DarkLight
Overview
The ability to use a Flow as a Data Source in a Report adds greater flexibility to the Report Designer. The Data Source Flow must be a synchronous Flow and must also output a Data Type List on the End step. This synchronous Flow operates on the backend to fetch data of a specified type, then the Flow Behavior allows it to be referenced in a Report as the Data Source. In the Data Source Flow, the data can come from multiple sources and be combined. When the Report appears at Runtime, the Flow executes and passes in the respective data.
Example
This example contains a Flow using the Get All step to receive all of the Account data in the Decisions environment. This Flow Behavior will be changed so that the Report will recognize it as a working source of data. The Report will then be able to use data fields as columns based on the fetched data from the Flow.
- In a Designer Folder, select CREATE FLOW from the bottom action panel.
- In the Create Flow window, navigate to Flow [Reports] and select Report Data Source Flow. Name the Flow and click CREATE.
- In the Flow Designer, locate the Steps > Integration > Internal Services > AccountService > GetAll step and connect it to the Start step and End step.
- Select the End step. Under Properties > Data > Output, click Show Editor.
- In the Data Definitions window, enter Accounts for the Name and search for the Account type. Enable Is List.
- Locate the Inputs > Accounts and change the input mapping to Select From Flow.
- In the resulting window, select Get All 1_Output. This will send the output results out of the Flow, to be received by the Report.
- Save and Close the Flow Designer.
- In the Designer Folder, select CREATE REPORT from the bottom action panel.
- In the Create Report window, select and name the default Report.
- In the Report Designer, select the Add button under the Data Sources section and navigate to Flow Reports > [Report Data Source Flow]. This is now telling the Report to pull data from the Flow running on the backend.
- Selecting the Add button in the Data Fields section will reveal that properties from the Account type are shown as if the data were being pulled in as a direct source.
- The Report will update in real-time as fields are added.