Case Entity CRUD Actions
  • 23 Feb 2022
  • 4 Minutes to read
  • Dark
    Light

Case Entity CRUD Actions

  • Dark
    Light

Overview

Case Entity Data Structures are typically used to delineate non-linear, data-driven, or state-driven processes (e.g. order fulfillment). 

Users may build, configure, and utilize CRUD actions to create, update, and delete a Case Entity's data with Flow logic. 

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



Prerequisite

To follow this tutorial, create a Case Entity Data Structure with the below data fields:  

CaseEntityPerson
Data Field NameData Field Type
FirstNameString
LastNameString
DOBDate time

After completing creation of the Case Entity, an Configuration Folder named "[CaseEntityName] Configuration" automatically generates. Clicking on this opens the Case Editor Page. CRUD actions will not be saved here however.

Do Not Store Data In The Configuration Folder
The Configuration Folder is meant for creating Flows, Rules, and other Designer elements to enhance the data structure. Data should instead be saved to a Folder: not a Configuration Folder.

To store the CRUD Action Flows, create a new Designer Folder. It is a best practice to name it after its Data Structure, in this case, "CaseEntityPerson CRUD" suffices. The following examples will take place here.

To store the Case Entity's data, create a Folder that the following examples will reference. For this example, it is named "CaseEntityPerson Data".


Create

  1. In the Designer Folder, create a new Flow and name it "CaseEntityPerson Create". It will automatically open in the Flow Designer.
  2. In the Flow Designer, navigate to Toolbox > USER DEFINED TYPES > CASE ENTITY > CASEENTITYPERSON. Add a Create Person step to the Start and End steps.

  3. With the Create Person step selected, in the Properties panel > INPUTS > Extension Data field, change the input mapping from Unknown to Build Data.

    Notice the appearance of the Case Entity values "DOB", "FirstName", and "LastName". Change the input mappings on each from Unknown to Constant and input example information.
  4. Change the input mapping for Folder Description and Folder Name from Unknown to Constant then input example information. For Parent Folder ID, select PICK and choose the Folder to store data: "CaseEntityPerson Data".

Debug

  1. In the Flow Designer, select the Debug action from the top action bar. This automatically saves the Flow.
  2. Click START DEBUGGING.

The Flow creates a record in the CaseEntityPerson Data Folder with the inputted information.

Notice that the ID was automatically created in the Folder when the Flow was run, even though its input value was set to Ignore.


The newly created data record is also visible when sourcing the Case Entity in a Report.



Update

Users may update their data with either the Edit [CaseEntityName] step or the Selective Update [CaseEntityName] step found alongside the Create [CaseEntityName] step in the Toolbox.

The two steps offer two different methods of editing Case Entity data records:

  • Edit: Changes every data field even those not intended to change. Any fields left without a value will become Null, so enter data to prevent this.
  • Selective Edit: Changes only the data field(s) that were given new value(s). Leaving fields blank instead maintains their original values and thus will not become Null.

For most uses cases, Selective Edit is recommended over the Edit step.

Update Flows rely on the Fetch Entities step to grab the correct data record(s) to change in a Data Structure by passing the data record's ID into the Edit or Selective Update steps. 

Edit Step

  1. In a Designer Folder, create a new Flow and name it "CaseEntityPerson Update". It will automatically open in the Flow Designer.
  2. From the Toolbox's Favorite section, add a Fetch Entities step after the Start step.
  3. In the Fetch Entities' Properties tab, change its Type Name search for the Case Entity: "CaseEntityPerson".

  4. After the Results outcome of the Fetch Entities step, add a Edit CaseEntityPerson step found under Toolbox > USER DEFINED TYPES > CASE ENTITY > CASEENTITYPERSON. Connect the No Results path to the End step.
  5. View the Edit CaseEntityPerson's Properties. For Extension Data, change its mapping type to Build Data. 

    For the CaseID, EntityID, and ExtensionID inputs, change the mapping type to Select From Flow and map the respective IDs of the record to edit such as EntityResults.First.EntityId

    Change the "FirstName", "LastName", and "DOB" data fields' mappings to Constant then enter example information different from the Create example.
    Null Example
    The "DOB" field is left blank in this example to demonstrate occurrence of null values when leaving a field blank.
  6. Change the input mapping for Folder Description and Folder Name from Unknown to Constant then input example information.

    For Folder ID, enter the Folder ID of the Folder storing data.

Selective Update Person

  1. Repeat steps 1-3 in the Edit step example above.
  2. After the Results outcome of the Fetch Entities step, add a Selective Edit CaseEntityPerson step found under Toolbox > USER DEFINED TYPES > CASE ENTITY > CASEENTITYPERSON. Connect the No Results path to the End step.
  3. View the Selective Edit CaseEntityPerson's Properties. For Extension Data, change its mapping type to Build Data. 
    For the CaseID, EntityID, and ExtensionID inputs change the mapping type to Select From Flow and choose the respective IDs of the record to edit within the results of the Fetch Entities step.

    Change the "FirstName", "LastName", and "DOB" data fields' mappings to Constant then enter example information different from the Create example. This example will only change the "FirstName" field.
  4. After running the Flow, the data updates with the provided field values.

Debug

  1. In the Flow Designer, select the Debug action from the top action bar. This automatically saves the Flow.
  2. Select START DEBUGGING.

Once the Flow runs successfully, it updates the specified data record with the new data field values.



Delete

  1. Repeat steps 1-3 in the Edit step example above.
  2. After the Results outcome of the Fetch Entities step, add a Delete CaseEntityPerson step found under Toolbox > USER DEFINED TYPES > CASE ENTITY > CASEENTITYPERSON. Connect the No Results path to the End step.
  3. View the Delete CaseEntityPerson's Properties. For EntityID, change the mapping type to Select From Flow and choose the Entity ID of the record to remove within the results of the Fetch Entities step.

  4. After running the Flow, the specified record is deleted from the Case Entity.


Was this article helpful?