- 14 Feb 2022
- 2 Minutes to read
- Print
- DarkLight
Defined Data Structure CRUD Actions
- Updated on 14 Feb 2022
- 2 Minutes to read
- Print
- DarkLight
Overview
This article will demonstrate performing Create, Read, Update, and Delete (CRUD) actions, via Flow steps, on Defined Data Structures.
Getting Started
Create an Entity Data Structure with applicable attributes, such as the Person example below:
Person | |
Firstname | String |
Lastname | String |
DOB | Date time |
Setting the storage option to "Database Stored" saves Defined Data Structures in the Database, thus creating a Folder for data storage is not necessary.
Create
To create a record in the Person Defined Data Structure:
- Create a Flow.
- Click the Flow Steps panel; expand the User Define Types category.
- Expand the Defined Data Structures[Advanced] category.
- Expand the Person data structure.
- Drag the Create Person step onto the Flow canvas.
- Connect it to the Start and End steps.
- Set Folder Id to a constant value and pick the Person Entity Data Folder.
- On the Item To Create input, change Unknown to Build Data.
- Set constant values for Name, Firstname, Lastname, and DOB.
10. Click Debug on the top Action Bar; this will record a save and run the Flow to create that record in the Person Defined Data Structure.
Read
Before an Update or Delete action can be performed, an existing record should first be located, or read.
Update
The Edit Person and Selective Update Person steps in the Flow Steps panel may be used to update an existing record stored in the Person Defined Data Structure.
- Edit Person step - changes ALL data fields, even if only 1 is specified
- updates the specified data field(s) to the provided parameter(s)
- overwrites non-specified parameter(s) to NULL (or Empty)
- Selective Update Person step - only changes the data field(s) specified
- updates the specified data field(s) to the provided parameter(s)
- ignores non-specified parameter(s), leaving existing data in tact
Edit Person Step
'Selective Update Person' Step
Delete
To remove a record from the Person Defined Data Structure, use the Delete Person step, found nested under User Defined Types > Defined Data Structures [Advanced] > Person in the Flow Steps panel. Once the required Id is provided as step Input, running the Flow will delete the record from the database associated with that Id.