- 12 Jul 2022
- 1 Minute to read
Bulk Insert to an External Database
- Updated on 12 Jul 2022
- 1 Minute to read
For an External Database Integration, multiple entities can be added to a table using the Bulk Insert to [Database Table Name] step.
This step operates similarly to a Batch Insert step, in that it allows users to add multiple instances of a specific DataType that are either mapped from another source or mapped directly on the step via Constant mapping, to a Database.
However, this step can only be used to insert to a specific External Database Table with the Insert Property enabled on it. The following document demonstrates how to enable this property and how to use the Bulk Insert step to update an External Database Table via Flow.
To use the Bulk Insert step for a specific External Database Table, the Insert Property must first be enabled for the Table. To do so either enable it from the Define Flow Steps window upon adding the Table Integration or:
- From the Decisions Studio, navigate to System > Integrations > Databases [NAME OF DATABASE].
- Right-click the desired Table, then click Edit Table.
- Click NEXT through each window until the Define Flow Steps window appears.
- Under Define Flow Steps, check the Insert Boolean.
- Click SAVE to save the changes and close the window.
The following example demonstrates using the Bulk Insert step to add entities (in this case Accounts) to a connected Postgres Database:
- From a Designer Project, create or update an existing Flow.
- From the Flow Designer, in the Toolbox tab, navigate to Integration > DATABASE > [NAME OF DATABASE] > [NAME OF DATABASE TABLE], and attach a Bulk insert to [Database Name] step to the workspace.
- Connect the step to the Start and End steps.
- From the Properties tab of the Bulk Insert to step, under INPUTS > Inserted Objects define the items which will be added to the Table. In this case, mapping was set to Constant, and values were manually added.
If a list of entities needs to be passed as inputs to the step, they must use the datatype generated for the Table, which can be found under the Inputs section in the Properties panel. In this case, it is PostGresTest_publicaccounts.
- Save the Flow, then Debug. If the inputs are valid, the Flow will travel down the Inserted path and the Table will be updated.