Use Flow Steps to Integrate with an External Database
  • Updated on 05 Mar 2019
  • 5 minutes to read
  • Print
  • Dark
    Light

Use Flow Steps to Integrate with an External Database

  • Print
  • Dark
    Light

After an External Database has been created and integrated into Decisions, use specificFlow Steps to integrate the external data into the flow. When integrating with a Database in Decisions use Flow Steps to Update, Delete andInsert Steps that interact with the integrated Database in the Flow. Display data from an integrated database using a Data Grid component on the Form .

Example

Steps

External Database Flow Steps
Create a Flow and use the Insert, Update andDelete Steps against the Database we just integrated with. We navigate to the designer folder and select the Create Flow button from the Folder Actions Panel. Name the Flow (Insert Update Delete Steps Flow), and select Create to proceed to the Flow Designer .
In the Flow Designer we expand Integrations > My Integrations > Database > Integrated Db Name(Database) > integrated table name category. Here we can find all steps to interact with the integrated Database . First, we add Delete [table name] Step
2018-08-22_160458.jpg

Then, connect Failed outcome from the Delete Step to the End step in our Flow . Select the Delete step in the flow designer and locate the step properties (Figure 9). The record that will be deleted with this step should be identified by the Primary Key ID from the table (in this case UnitID is a primary key in the integrated table) . For the UnitID we select Constant Mapping type and provide desirable Value . Then, we click Add Step .
2018-08-22_160829.jpg

Now add an Insert to [table name] step fromIntegrations > My Integrations > Database > Integrated Db Name > Insert to dbo.zipCodes [integrated table name]. Connect the Deleted Outcome pathway  from Delete step.
2018-08-22_161002.jpg

In the same manner, as we did with the Delete step, get the Failed outcome Step from the Insert Step and connect it to the End step. Select the Insert step in the Flow designer and set the properties of the step. Select Edit Input Mapping.
2018-08-23_123152.jpg

This step is able to insert an Array of records into the table. In the properties tab under Inputs, select theBuild Array option for Inserted Objects . Then for the first record (Item 0) in the Array select Build Data , and create a Record by filling in each field with Constant Values .
2018-08-23_142313.jpg

Back in the Flow designer we add Update [table name] step from the Integrations > My Integrations > Database > Integrated Db Name(Database) > Update dbo.zipCodes [integrated table name] on the Inserted Outcome from Insert step.
2018-08-22_162446.jpg

Again, connect the Failed outcome from the Update Step to the End Step in the Flow. Edit the Step properties tab.
2018-08-23_143314.jpg

Update step is very similar to Insert step. Under Inputs configure data for this step in the exact same manner as we did for the Insert step. 
2018-08-23_143604.jpg

To display data from the table we need to query it first. In order to obtain data from the table first add a Get all from [table name] Step tab the flow. In the Steps tab locate Integrations > My Integrations > Database > Integrated Db Name(Database) > Get all from dbo.zipCodes [integrated table name] , and connect the Updated Outcome pathway to the step (Figure 9).
2018-08-23_144401.jpg

We connect Failed outcome from Get all from [table name] step to the End step in the Flow , and edit the step properties. This step does not require specific Input configuration. The only input that is configured is Limit of Records. In this case, we just ignore this Input (Figure 10) . Mention, the data type that is being returned from this step. We will use this data type for the Data Grid in the next step, which will be a Form
2018-08-23_145243.jpg

Select Add Step to add the final step to the Done outcome from Get All step. Create a Form to display all records from the table in the Grid . Add Show Form step from Favorite Steps category and provide this step with a Name.
2018-08-23_145058.jpg

In the resulting window Name the Form and click Create to proceed to the Form Designer. Each Form should have at least one outcome. We add Button component from the Actions category in the ToolBox to our Form . Then, name the text on the Button to “Done”. Use a Data Grid component to Display data from our table. Locate Data Grid in the components under Favorites.
2018-08-23_151221.jpg

Next, we need to configure our Data Grid component. In order to display data from our integrated table, we need to configure Data Grid component to accept the appropriate Type . In this case, Type should match Data Type that is coming out of the Get All step (dbo.ZipCodes). Locate this Type in the Table Definition Types category using Type picker.
2018-08-23_151723.jpg

After the Data Grids properties are defined with a name and the dataType, define the columns that will be displayed on the grid, under column information. Under Output Data select the output mode, for this example the InfoOnly mode will be selected from the drop-down selection.  
2018-08-23_152852.jpg

Moreover, we can add Row actions and Row Links to the Data Grid component (Figure 15). When we finished with Data Grid component, we can Save and Close Form Designer to return back to the Flow Designer.
2018-08-23_153059-300x251.jpg

In the Flow designer we connect the Outcome from our Form to the End Step . Then, we click on the Form Step and select Show Mapping Editor option.
2018-08-23_154518.jpg

In the Mapping Editor we map outcome data from the Get all step to the Data Grid component Name in our Form . Then, click Ok to close Mapping Editor.
2018-08-23_160406.jpg

This completes our Flow . To test it we click Debug Flow link on the top panel of the Flow Designer .
2018-08-23_155317.jpg

Our Flow runs in the Debugger and first thing that we see is our Form. Behind the scenes our Flow does all work as we designed. Our Form displays the records from our database table with changes that were done by our Flow .
2018-08-23_163106.jpg

Debugger indicates that our Flow ran with no errors.
2018-08-23_163234.jpg

Look at the original database to onfirm that the Flow did design changes to the table. This completes this Flow example using Insert, Update and Delete steps.

Was this article helpful?