External Entity CRUD Actions

Prev Next

Overview

An External Entity uses data not stored in Decisions to create a Data Structure used similarly to an internal Data Structure. The External data may also build actions within a Configuration Folder similar to its internal counterparts.

External Entities shine in use cases where an external database or structure cannot be migrated into a different environment, and users want Portal visible actions on the data.

Inside the Configuration Folder, the Designer View displays a list of Flows representing different potential actions. The External Entity's capabilities are limited until these Flows are built. This article demonstrates how to use the Create, Update, and Delete steps with an External Entity Data Structure to build these Flows and their respective actions.

Do Not Store Data In The Configuration Folder
The Configuration Folder creates flows, rules, and other designer elements to enhance the custom data structure. It is incapable of storing process-specific data.

Example

For this tutorial, a Database was integrated with a table named 'Person', including the following fields:

Please navigate to External Database Integration for more information on integrating an External Database into Decisions. 
Person
Column Values
DataType
PersonID
Varchar(255)
Firstname
Varchar(255)
Lastname
Varchar(255)
DOB
Date

To quickly create the table and values, copy and paste the following SQL commands into SQL Server Management Studio; these commands will create the table and its test values.

CREATE TABLE Person (PersonID varchar(255), Firstname varchar(255), Lastname varchar(255), DOB date);
insert into dbo.Person (PersonID, Firstname, Lastname, DOB)
values ('8ce8be77-fe28-43ef-8b96-4c3743192a0e', 'Jill', 'Doe', '2021-10-30');

insert into dbo.Person (PersonID, Firstname, Lastname, DOB)
values ('f048a932-4619-4b8e-8b94-79450b59af9c', 'Jake', 'Doe', '2021-10-25');

insert into dbo.Person (PersonID, Firstname, Lastname, DOB)
values ('cf80321e-6c6c-4e66-867e-ec24d710df39', 'Blake', 'Doe', '2021-10-17');

Create External Entity Data Structure

The final part of the setup is to create an External Entities Decisions Data Structure. It will have fields similar to the external database table.

Person
Data Field
DataType
PersonID
String
Firstname
String
Lastname
String
DOB
DateTime

Once created, the Configuration Folder for External Entities will contain default CRUD action flows. These Flows are not pre-configured and will need to be designed.


Setting Up the Configuration Folder for External Entities

Creating an External Entity Data Structure alone does not make CRUD steps available in the Flow Designer. These steps become accessible only after configuring the default action flows within the External Entity's Configuration Folder. The following instructions outline how to bind these flows to an External Entity so that they appear under Toolbox > USER DEFINED TYPES > EXTERNAL ENTITIES > [EntityName].

Key Point 
External Entities are intended for use when the internal Decisions database is not preferred, and integration with an external database is required. If the action flows within the Configuration Folder are not correctly configured and saved, the CRUD steps (e.g., Save [Entity], Delete [Entity], Get All [Entity]) will not appear in the Flow Designer.

For setup instructions on external database integration, refer to the official documentation: External Database Integration.
  1. Open the Configuration Folder created alongside the External Entity Data Structure. For example: [DocumentationProject.Person Delete].
  2. Locate the default placeholder action flows inside the Configuration Folder. Flow names typically follow this pattern:
    • [DocumentationProject.Person Delete]
    • [DocumentationProject.Person Fetch All]
    • [DocumentationProject.Person Fetch]
    • [DocumentationProject.Person Get ID From Entity]
    • [DocumentationProject.Person Save]
    • [DocumentationProject.Person Search]
  3. Open each placeholder Flow and complete its configuration. Below is an example configuration:
    1. [DocumentationProject.Person Fetch All]:
      - Drag the Raw SQL step from the Toolbox into the Flow.
      - Enable "Use External Database".
      - Under External Database, select the configured database (e.g., ExternalEntity-DB created in PostgreSQL).
      - In the Inputs section, enter the following SQL query to retrieve all records from the table:
      SELECT * FROM PERSON

Create

To create a record in the Person External Entity Data Structure

  1. In the Configuration Folder, open the [ParentFolder.ChildFolder.DataStructureName Save] Flow.
  2. In the Flow Designer, navigate to the Toolbox > USER DEFINED TYPES > EXTERNAL ENTITIES > PERSON category and drag a Save [Person] step to the workspace and connect it to the Start step and End step. 
  3. With the Save [Person] step selected, navigate to Properties > INPUTS > Entity field and change the input mapping to Build Data
  4. Notice the expansion of input values. For each input (DOB, Firstname, Lastname, PersonID), set the input mapping to Constant, and fill the fields with example information.
  5. Select Debug from the Top Action Bar; the Flow now creates the record in the Person External Entity Structure. 
    No Auto-ID Generation
    Notice that the PersonID was not automatically created when the Flow was run because External Entities are stored outside of Decisions.

Update

The Save and Get All steps are necessary to update an existing record in an External Entity Structure. The Save [Person] step changes a record's data in an existing Data Structure, while the Get All [Person] step retrieves the data and records to operate the Save [Person] step. 

All fields of the Entity must be filled with information, even those that remain unchanged. Leaving a blank value in a field saves a Null value for that field.

Save [Person] step

  1. Drag and connect a Get All [Person] step to the Start step.
  2. Drag and connect a Save [Person] step to the Get All [Person] step. Connect this step to the End step.
  3. With the Save [Person] step selected, navigate to Properties > INPUTS > Entity and change the input mapping to Build Data.
  4. Notice the expansion of input values. Change the input mapping to Constant for each new input (DOB, Firstname, Lastname, PersonID), and fill the value fields with example information.
  5. Select Debug from the Top Action Bar; this Flow now edits the record with the specific data.

Delete

Use the Delete [Person] and Get All [Person] steps to remove records from the External Entity Data Structure. The Delete [Person] step deletes the specified Entity record from the Data Structure. 

  1. Drag and connect a Get All [Person] step to the Start step.
  2. Drag and connect a Delete [Person] step to the Get All [Person] step. Connect this step to the End step.
  3. With the Delete [Person] step selected, navigate to the Properties> INPUTS > Entity field and change the input mapping to Select From Flow
  4. In the resulting window, select Entities, then drill down to Last.