Using a Flow to Source a ReportLast Updated: 08/12/2016 Introduced in Verision: 2.0 |
Using a flow to source a Report enables Reporting on virtually any data source. A flow can make a web service call and thus make that data Reportable in the Portal, for example. Using a flow to source a Report makes it possible to use multiple data sources as well. Every time the Report is run, the flow executes and passes in the respective data.
Example 1
Video example of using a Zip Code web service to source a Report: http://screencast.com/t/pyU7yKDIaNdZ
Example 2
The goal of this example is to:
- Create and configure a flow to get all Portal users.
- Create a Report using information gathered in the flow.
- Run the Report.
Firstly, as of Decisions version 3.5, the portal has been split into the User Portal and Studio views. In order to create our project, we’ll need to be in Studio mode, which is easily identifiable by the orange header. To enter Studio mode, click the Open Studio button in the top-right.
Now that we’re in Studio mode, it’s time to create our Designer Folder. Navigate to the folder you want to the project to live in. In this case, the project will be stored in the My Designs folder.
Now create the Designer Folder and name it whatever you’d like.
Inside our Designer Folder, we can begin to create the Flow. Do this by clicking Create Flow at the bottom of the page.
In order to use this flow as a data source for a Report, its Flow Behavior needs to be changed. By setting the Flow Behavior to Reporting Data Source Flow, an output will be required on the End Step, which allows us to send data from the Flow to the Report.
Give the flow a name and select Reporting Data Source Flow from the Behavior drop-down list.
Additionally, you can change the Flow Behavior after creating the Flow by right-clicking it, and looking under Edit > Advanced > Set Flow Behavior.
In the resulting Set Flow Behavior pop-up window, select the option Reporting Flow, then click the Set button.
The Flow Designer will open.
In the Flow Designer start-up window expand Integration > Internal Services > AccountService category. Next, select Get All component and click Add to add it to the workspace.
Next, connect the output from the Get All 1 step to the End step.
Because we want our Report to use data passed in from this Flow, we need to configure the End Step to output data gathered in the Flow.
To do this, click on the End step and in the Properties Panel, under Output section, in the Data section click the Add New button.
In the resulting Add Data pop-up window, configure the output data. The user can either manually fill in the information or click the Pick From Flow Data link. Click this link, and a pop-up will open, listing all the data available at the end of the Flow. Because our Get All 1 step is the one grabbing the account data, we should choose the GetAll1_Output option and click OK.
Since the output is an array of accounts, check the Is List checkbox. Click Ok to close the window.
At this point, there should be no errors present on the screen. To verify the flow works, click the Test Flow button in the top menu bar and press the big Play button that will appear.
The debugger runs and displays the results. The user can view the results either in the Diagram tab or the Data tab. Additionally, the events that occurred during the flow execution are listed on the left.
Close the debugger to return to the Flow Designer window, where we will save it and close the Flow Designer.
At this point, we have our Flow, which is getting the account data we want in our Report, so we can create the Report now.
In the portal, click on the Create Report/Page button and select Create Report.
In the resulting pop-up window, name the Report and click Create.
Once in the Report Designer, we’ll begin by selecting a data source for the Report.
In the Toolbox Panel, expand the Data Sources > Flow Reports category, where you’ll find the Flow we created earlier is now a Data Source for the Report.
Now that the source Flow we made is a Data Source, it appears in the Toolbox. Click it, and all the fields contained within will be available to add to our Report. Select the items you want on the Report.
Note: there may be a delay in repopulating the list after each item is selected. This is because the flow must execute after each item is added to the workspace.
The Report is now complete. Save it and close the Report Designer.
Back in our Designer Folder, we can click the Run Report option from the Report’s Action menu, or by right-clicking the Report.
The Report will run and display the information fields specified based on the data gathered in our source Flow.