External Entity CRUD Actions
  • 03 Mar 2023
  • 3 Minutes to read
  • Dark
    Light

External Entity CRUD Actions

  • Dark
    Light

Article Summary

Overview

An External Entity accepts 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, a list of Flows representing different potential actions is displayed in the Designer View. 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 is meant for creating Flows, Rules, and other Designer elements to enhance that 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 ValuesDataType
PersonIDVarchar(255)
FirstnameVarchar(255)
LastnameVarchar(255)
DOBDate

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 FieldDataType
PersonIDString
FirstnameString
LastnameString
DOBDateTime


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


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 [Personstep 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. For each new input (DOB, Firstname, Lastname, PersonID), change the input mapping to Constant, 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.

Was this article helpful?