Entity Extension CRUD Actions
  • 21 Aug 2024
  • 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). 

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

CRUD Action Steps: Entity Extension
The Create, Update, and Delete steps cannot be searched in the Flow Designer's Toolbox. 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. Ensure this Entity contains at least one record to extend its data.

Financial Account
Data Field NameData Field Type
AccountIDString
AccountHolderString
AccountTypeString
BalanceString
AccountStatusString

Entity Extension

After creating the Entity Structure, create an Entity Extension with the following fields and tie it to the previously created Entity. This extension allows the association of multiple account owners with a financial account. It's particularly useful for joint accounts or accounts with multiple beneficiaries.

AccountOwnership
Data Field NameData Field Type
OwnerIDString
OwnerTypeString
OwnerPercentageDecimal
RelationshipString
ContactDetailsString

Create


End Result


OLD Update section BELOW:

  1. Navigate to a Designer Folder, create a Flow, and name it "EE Create Flow". It will automatically open in the Flow Designer.
  2. Add a Fetch Entities step in the Toolbox's Favorites category 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.
  5. Connect the No Results outcome to the End step.
  6. 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.
  7. Navigate to INPUTS > Entity Person, change the input mapping from Ignore to Select From Flow, and select Entity Results.First.

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.
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.


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?