Return Dynamic Data Rows When Fetching Data From Database
  • Updated on 17 Sep 2014
  • 2 minutes to read
  • Print
  • Dark
    Light

Return Dynamic Data Rows When Fetching Data From Database

  • Print
  • Dark
    Light

OVERVIEW

Database Entities represent external databases which can be integrated with a flow. To add a database within the portal, navigate to the folderSystem>Designers>Integrations>Databases , click Add Table. Once a database is introduced we can manipulate and extract data from the database table from within the Flow Designer. To add a database table to the Flow Designer go to Integrations>My Integrations>[database Name]> [Table Name].

Example

When Fetching Data from an external database it can be difficult to pinpoint the data's type. Decisions has the ability to handle this dynamic data for us.
In this example, we are going to fetch data from a database table, establish it is as Dynamic Rows, and display it on a form. For this example, we will integrate with a dbo_entity_account table from the Decisions database. To do this go to System > Integrations > Databases > Add Table > select the database name from the drop-down list.
Add-table.jpg

Select the Object you wish to use for the flow. In this example, dbo.entity_account is used.
dbo-1.jpg

Select or unselect the properties needed. 
2018-08-15_153806-1.jpg

Start in a Designer Folder, Create a Flow to open the flow designer. In theFlow Designer, add a Get all from database step. Navigate to Integrations > My Integrations > Database > (Select your specific database connection) > dbo_entity_account (Table) category. Within the specific database table,  select the Get all from dbo_entity_account step.

Next configure the settings on the Get all from dbo_entity_account step.  In the properties tab on the right under Output Settings select the Data Rows option from the Return Data Option drop-down list.
2018-08-15_162158.jpg

Next, locate the For Each Step in the Steps Tab and Add it to the flow. In the properties tab on the right under Data choose the Type from the drop-down list. Locate the database under User defined Types>Database (Advanced), then select the specific database that is being called for the flow. 
Note: Under Outputs on the For Each Step, a single Item that is of the type Dynamic Data Row and has numerous fields that we can use in the flow to display our data. 
2018-08-15_161129.jpg

Create a Form
Next, add a [Pick or Create Form] step to the flow. Now create a form that will display theDynamic Row. First, locate a label component and dragtwo onto the form. Set the labels to dynamic and they will display data from the flow. 
2018-08-16_105233.jpg

To accomplish this in the Properties Tab , underCommon Properties check the box, (Text from Data Name) and supply a data name that will represent the field.  Locate the drop-down under Validation Source and underAsterisk for a required field, selectDynamic
2018-08-16_105440.jpg

Save and close to return back to the Flow Designer .  Select the Form to edit the Inputs, here the two labels can be specified to the database. Set Item Feild 1 and Item Feild 2 to select from the flow. Here specify what input to select from the database.
2018-08-16_150214.jpg

Assemble the flow using the image below. Next, debug the flow to see the rows dynamically populated from the database. 
2018-08-16_150802.jpg

When the flow debugger runs the field values are displayed on the form.
2018-08-16_154112.jpg

Clicking the Next button will step through each row in the database table and display the fields that we specified.

Was this article helpful?