Entity Extension CRUD Actions
  • 11 Dec 2024
  • 4 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). 

Entity Extension CRUD actions can be used to configure the extension's fields for its attached Entity.

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.



Prerequisites

Entity Data Structure

For this tutorial, create an Entity Data Structure created with the following data fields:

EntityPerson
Data Field NameData Field Type
FirstNameString
LastNameString
DOBDate time

Ensure this Entity contains at least one record so its data may be extended.

Entity Extension

After creating the Entity Structure, create an Entity Extension with the following fields and tie it to the previously created Entity:

AdditionalPersonInfo
Data Field NameData Field Type
SSNString
EmployedBoolean
AddressString



Create

  1. Navigate to a Designer Folder and create a Flow, and name it "EE Create Flow". It will automatically open in the Flow Designer.
  2. In the Toolbox's Favorites category, add a Fetch Entities step after the Start step.
  3. Open the Fetch Entities' Properties. For the Type Name, select the original Entity to extend. For this example, this is 'EntityPerson'.
  4. Navigate to the Toolbox > USER DEFINED TYPES > ENTITY EXTENSIONS > ADDITIONALPERSONINFO_ENITITYPERSON category. Drag a Create AdditionalPersonInfo step after the Results outcome of the Fetch Entities step.

    Connect the No Results outcome to the End step.

  5. In the Properties panel of the Create AdditionalPersonInfo_EntityPerson step, change the Item to Create input's mapping type from Unknown to Build Data.

    Locate the AdditionalPersonInfo input and change its input mapping to Build Data. Provide example information for the Extension's fields by changing the input mappings from Ignore to Constant.
  6. Navigate to INPUTS > Entity Person and change the input mapping from Ignore to Select From Flow and select Entity Results.First.

Debug

  1. Select Debug from the Top Action Panel, doing so will save the Flow and open the Debugger. After it runs, save and exit the Flow.
  2.  Create a new Flow and add a Fetch Entities step after the Start step.

    For Type Name, select EntityPerson to grab the Entity and for Extension Type Name select the Entity Extension. In this example, this is 'AdditionalPersonInfo'.

    This step now gathers and displays the data fields for both the original Entity and its now created Entity Extension.


Update

  1. Navigate to a Designer Folder and create a Flow, and name it "EE Update Flow". It will automatically open in the Flow Designer.
  2. In the Toolbox's Favorites category, add a Fetch Entities step after the Start step.
  3. Open the Fetch Entities' Properties. For the Type Name, select the original Entity to extend. For this example, this is 'EntityPerson'.
  4. Navigate to the Toolbox > USER DEFINED TYPES > ENTITY EXTENSIONS > ADDITIONALPERSONINFO_ENITITYPERSON category. Drag an Edit AdditionalPersonInfo step after the Results outcome of the Fetch Entities step.

    Connect the No Results step to the End step

  5. In the Properties panel of the Edit AdditionalPersonInfo_EntityPerson step, change the Item to Create input's mapping type from Unknown to Build Data.

    Locate the AdditionalPersonInfo input and change its input mapping to Build Data. Changing the Extension's input mapping from Ignore to Constant and edit the desired fields.
  6. Navigate to INPUTS > Entity Person and change the input mapping from Ignore to Select From Flow and select Entity Results.First.

Debug

Preventing Null values after editing data fields
Update every field when using the Edit step even those that will not change its value. Any fields left without a value, new or otherwise, will be set to Null. Failure to do this will result in data loss.
  1. Select Debug from the Top Action Panel, doing so will save the Flow and open the Debugger. After it runs, save and exit the Flow.
  2. Create a new Flow and add a Fetch Entities step after the Start step.

    This step now gathers and displays the edited data fields.



Delete

Entity Extensions contain no Delete steps. Instead, the Edit AdditionalPersonInfo_EntityPerson step will be used again to produce empty values. 

  1. Navigate to a Designer Folder and create a Flow, and name it "EE Delete Flow". It will automatically open in the Flow Designer.
  2. In the Toolbox's Favorites category, add a Fetch Entities step after the Start step.
  3. Open the Fetch Entities' Properties. For the Type Name, select the original Entity to extend. For this example, this is 'EntityPerson'.
  4. Navigate to the Toolbox > USER DEFINED TYPES > ENTITY EXTENSIONS > ADDITIONALPERSONINFO_ENITITYPERSON category. Drag an Edit AdditionalPersonInfo step after the Results outcome of the Fetch Entities step.

    Connect the No Results outcome to the End step.
  5. In the Properties panel of the Edit AdditionalPersonInfo_EntityPerson step, change the Item to Create input's mapping type from Unknown to Build Data.

    Locate the AdditionalPersonInfo input and change its input mapping to Build Data. Leave the new inputs with Ignore mappings; this will remove the additional values tied to the original Entity Data Structure.
  6. Navigate to INPUTS > Entity Person and change the input mapping from Ignore to Select From Flow and select Entity Results.First.

Debug

  1. Select Debug from the Top Action Panel, doing so will save the Flow and open the Debugger. After it runs, save and exit the Flow.
  2. Create a new Flow and add a Fetch Entities step after the Start step.

    The Edit step produces null values for the Ignored data fields effectively deleting their data.

Was this article helpful?