Entity Extension CRUD Actions
- 21 Jul 2022
- 4 Minutes to read
- Print
- DarkLight
Entity Extension CRUD Actions
- Updated on 21 Jul 2022
- 4 Minutes to read
- Print
- DarkLight
Article summary
Did you find this summary helpful?
Thank you for your feedback
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 Name | Data Field Type |
FirstName | String |
LastName | String |
DOB | Date 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 Name | Data Field Type |
SSN | String |
Employed | Boolean |
Address | String |
Create
- Navigate to a Designer Folder and create a Flow, and name it "EE Create Flow". It will automatically open in the Flow Designer.
- In the Toolbox's Favorites category, add a Fetch Entities step after the Start step.
- Open the Fetch Entities' Properties. For the Type Name, select the original Entity to extend. For this example, this is 'EntityPerson'.
- 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. - 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. - Navigate to INPUTS > Entity Person and change the input mapping from Ignore to Select From Flow and select Entity Results.First.
Debug
- 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.
- 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
- Navigate to a Designer Folder and create a Flow, and name it "EE Update Flow". It will automatically open in the Flow Designer.
- In the Toolbox's Favorites category, add a Fetch Entities step after the Start step.
- Open the Fetch Entities' Properties. For the Type Name, select the original Entity to extend. For this example, this is 'EntityPerson'.
- 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 - 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. - 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.
- 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.
- 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.
- Navigate to a Designer Folder and create a Flow, and name it "EE Delete Flow". It will automatically open in the Flow Designer.
- In the Toolbox's Favorites category, add a Fetch Entities step after the Start step.
- Open the Fetch Entities' Properties. For the Type Name, select the original Entity to extend. For this example, this is 'EntityPerson'.
- 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. - 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. - Navigate to INPUTS > Entity Person and change the input mapping from Ignore to Select From Flow and select Entity Results.First.
Debug
- 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.
- 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?