Case Entity CRUD Actions
  • 28 Aug 2024
  • 6 Minutes to read
  • Dark
    Light

Case Entity CRUD Actions

  • Dark
    Light

Article summary

Feature Details
Introduced in Version--
Modified in Version8.17
Modification DetailsAdded a new field on Create Step that overrides the configured prefix number in the Case Entity Data Structure.

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
The Create, Update, and Delete steps cannot be searched in the Flow Designer's Toolbox. Users will have to navigate to USER DEFINED TYPES > CASE ENTITY to add CRUD actions to the workspace. 

Step Properties

Settings

NameDescription
SkipDuplicateFolderNameCheckWhen marked true, the step will not verify whether an entity with the same name already exists.
Send EventAllows to send an event that will refresh the Folder.
SendThis action will trigger a refresh event within the Folder that contains the Entity Folder.
SendWithTreeChangeThis will send the refresh event that will also update the folder tree.
DoNotSendThis will not send any refresh event.

Inputs

NameDescription
Case PrefixThis will allow users to override the configured prefix number in the Case Entity Data Structure.
This setting is available only on version 8.17 and above.
Extension DataThis will allow users to configure all the parameters of the entity. Changing the mapping type to Build Data will expose all the fields. 
Folder DescriptionSets a description to the Folder.
Folder NameAllows to set the folder name of the entity.
Parent Folder IDThis will allow you to pick a folder to store the case entity. It is recommended not to store case entity data in the Configuration Folder.

Outputs

NameDescription
Folder ID                      The step will return the Folder ID of the created entity.                                  

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 the creation of the Case Entity, a Configuration Folder named "[CaseEntityName] Configuration" is automatically generated. 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 references the following examples. 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 a new value(s). Leaving fields blank instead maintains their original values and thus will not become Null.

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

One exception is with nested defined types. Selective Edit will clear out unmodified property values and acts the same as the Edit step.  The reason for this is that the entire nested object is received through mapping. This makes it impossible to identify which specific properties should be updated or ignored. Users can achieve selective updates by first fetching the data, mapping the existing nested data, and then updating the desired properties.

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

Feature Changes

DescriptionDateDeveloper Task
Added a new field on Create Step that overrides the configured prefix number in the Case Entity Data Structure.
8.17[DT-039263]

Was this article helpful?