Entity Extension CRUD Actions
  • 14 Feb 2022
  • 3 Minutes to read
  • Dark
    Light

Entity Extension CRUD Actions

  • Dark
    Light

Article Summary

Overview

An Entity Extension Data Structure extends the data stored in Decisions for an existing Entity Data Structure (e.g. a "Person" Entity with an "Address" extension). The following article will demonstrate how to use the Create, Update, and Delete steps in a Flow using an Entity Extension Data Structure tied to a previously created Entity Data Structure. 

CRUD Action Steps: Entity Extension
In the Flow Designer's Toolbox, Create, Update, and Delete steps cannot be searched for. Users will have to navigate to USER DEFINED TYPES > FOLDER EXTENSION to add CRUD actions to the workspace.

Example

For this tutorial, the Entity Extension Data Structure is tied to an Entity Structure created with the following fields:

EntityPerson
FirstnameString
LastnameString
DOBDate time

Entity Extension

After the Entity Structure was created, an Entity Extension with the following fields was created and tied to the previously created Entity:

AdditionalPersonInfo
SSNString
EmployedBoolean
AddressString

Create 

To create an Entity that contains an Entity Extension

  1. To begin, navigate to a Designer Folder and select CREATE FLOW from the Global Action Bar. 
  2. In the resulting Create Flow dialog, select and name the default Flow [EE Flow]. Click CREATE to open the Flow Designer.
  3. In the Flow Designer, navigate to the Toolbox > USER DEFINED TYPES > ENTITY EXTENSIONS > ADDITIONALPERSONINFO_ENITITYPERSON category and drag a Create AdditionalPersonInfo step to the workspace and connect it to the Results outcome of a Fetch Entities step.
  4. Connect the No Results outcome to the End step. 
  5. In the Properties panel of the Create AdditionalPersonInfo_EntityPerson step, navigate to the INPUTS > Item to Create field and change the input mapping from Unknown to Build Data.
  6. Notice the appearance of new inputs and locate the AdditionalPersonInfo input and change its input mapping to Build Data
  7. In its expansion, locate the Address, Employed, and SSN fields and change the input mappings from Ignore to Constant
    In this example, the input values are as follows: Address: 123 Example Dr, Employed: checked boolean, and SSN: 123-45-6789.
  8. Next, navigate to INPUTS > Entity Person and change the input mapping from Ignore to Select From Flow
  9. In the resulting Pick Data For Input: EntityPerson dialog, select Entity Results, then drill down to First
  10. Select Debug from the Top Action Panel, doing so will save the Flow and open the Debugger. Decisions will add the Entity Extension properties to the selected Entity object.

Update

To update an existing record in an Entity Extension Data Structure, the Edit AdditionalPersonInfo step is used. This step is found in the Toolbox > USER DEFINED TYPES > ENTITY EXTENSIONS > ADDITIONALPERSONINFO_ENTITYPERSON category and will change every data field even if the user changes only one data field. In order to change any record in a Data Structure, the Fetch Entities step is necessary to locate a record and pass it into the Edit step. 

Edit AdditionalPersonInfo step

When using the Edit AdditionalPersonInfo step, notice it is configured similar to the Create AdditionalPersonInfo step in the Properties panel > INPUTS > Item to Edit where the input mapping is set to Build Data, and the Address, Employed, and SSN values have a Constant input mapping with new random information. The INPUTS > EntityPerson value has a Select From Flow input mapping and EntityResults is selected then drilled down to First.
If the Edit step is used to change one field, that field will update with the new value, and all unchanged fields will be set to Null or Empty.

Delete

For Entity Extensions, there are no Delete steps in the Toolbox > USER DEFINED TYPES > ENTITY EXTENSIONS > ADDITIONALPERSONINFO_ENTITYPERSON category. In order to remove a record from an Entity Extension, the Edit AdditionalPersonInfo_EntityPerson step will be used again. 

  1. To delete a record, drag an Edit AdditionalPersonInfo_EntityPerson step to the workspace and connect it to the Results outcome of the Fetch Entities step. The No Results outcome should be connected to the End step, as seen above.
  2. With the Edit AdditionalPersonInfo_EntityPerson step selected, navigate to the Properties panel > Item to Create and change the input mapping to Build Data. Leave the new inputs with Ignore mappings; this will remove additional values that were tied to the original Entity Data Structure.
  3. Next, navigate to INPUTS > EntityPerson and change its input mapping to Select From Flow
  4. Select EntityResults from the output Fetch Entity step, then drill down to First. This will complete the steps necessary to delete a record from an Entity Extension Data Structure.

Was this article helpful?