- 20 Sep 2021
- 2 Minutes to read
Using a Flow to Source a Report
- Updated on 20 Sep 2021
- 2 Minutes to read
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.
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 Project, select CREATE FLOW on the top bar.
- Select the large Flow tile and provide a name, then select CREATE.
- In the Flow Designer, locate the SETTINGS section of the Properties.
- Expand the Behavior Type dropdown and choose Report Data Source Flow.
- In the Toolbox, navigate to INTEGRATION > INTERNAL SERVICES > ACCOUNTSERVICE and locate the Get All step, then move it to the workspace.
- Connect the steps in succession as shown below.
- Select the End step so that the Properties for it appear.
- Locate the DATA section and select SHOW EDITOR under the Output box.
- Enter Accounts for Name and search the Account type, then check the Is List box.
- Locate the INPUTS section, select Pick in the Accounts box and choose the Get All Output Results. This will send the output results out of the Flow, to be received by the Report.
- Save and close the Flow Designer once complete.
- Back in the Designer Project, select the CREATE REPORT button from the top.
- Choose the large Report tile and provide a name, then select CREATE.
- Select the Add button under the Data Sources section and expand Flow Reports, then choose Report Source Flow. This is now telling the Report to pull data from the Flow running on the back-end.
- 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.