- 06 Jun 2022
- 2 Minutes to read
-
Print
-
DarkLight
Entity Extension CRUD Actions
- Updated on 06 Jun 2022
- 2 Minutes to read
-
Print
-
DarkLight
Preparation
This article will demonstrate using the Create, Selective Update, and Delete Flow steps for Decisions Entity Extension Structure. Before continuing to the next section, create an Entity Data Structure in Decisions with the following field names:
Person | |
Firstname | String |
Lastname | String |
DOB | Date time |
Entity Extension
After the Entity Data Structure is created, create an Entity Extension, tie it to the previously created Entity, and that has the following fields:
AdditionalPersonInfo | |
SSN | String |
Employed | Boolean |
Address | String |
Create
To create an Entity that contains an Entity Extension
- Create a Flow
- Expand the 'User Define Types' category
- Expand the Entity Extensions category
- Expand the 'AdditionalPersonInfo_Person' datatype
- Drag over the 'Create AdditionalPersonInfo_Person' step onto the flow canvas
- Connect it to the 'Start' and 'End' step and change the 'input type' to 'Build Data'
- Set constant values for 'Address', 'Employed', and 'SSN'
- Set the 'Person' input to 'Select From Flow' and map a Person object from the Fetch Entities to the 'Person' input.
Click the 'Debug' button to run the flow. Decisions will add that Entity Extension properties to the selected Entity Object.
Update
To update an existing record in a Database Structure the 'Edit AdditionalPersonInfo'. This is found in User Defined Types -> Database Structures -> Person. The 'Edit AdditionalPersonInfo' step will change every data field in the object even if the user only changes one data field. In order to change any record in a data structure, the 'Fetch Entities' step will need to be used to get that particular record. Then pass the Id of the record to be changed into the Edit.
'Edit AdditionalPersonInfo' Step
Delete
For Entity Extensions, there are no delete steps in the User Defined Types -> Entity Extensions -> AdditionalPersonInfo. In order to remove an Entity Extension, the 'Edit AdditionalPersonInfo' will be used. This is done by mapping the Person Entity from the 'Fetch Entitites' step into the 'Person' input on the 'Edit AdditionalPersonInfo' step. Then set the input type on the 'AdditionalPersonInfo' to 'Build Data', and leave all the values to 'Ignore.' When the Flow is run, it will remove the additional Entity Extension values that were on tied to the Person Entity.