- 20 May 2022
- 1 Minute to read
- Print
- DarkLight
Database Structure CRUD Actions
- Updated on 20 May 2022
- 1 Minute to read
- Print
- DarkLight
Overview
This article will review the use of Create, Read, Update, and Delete (CRUD) actions, via Flow steps, for Database Structures.
Preparation
Create a Database Structure with applicable attributes, such as the Person example below:
Person | |
Firstname | String |
Lastname | String |
DOB | Date time |
Create
To create a record in the Person data structure:
- Create a Flow; find and select the Steps panel.
- Expand the User Defined Types category.
- Expand the nested Database Structure category.
- Expand the Person data structure.
- Drag the Create Person step onto the Flow canvas.
- Connect the Start path to the Create Person step; drag the step's Done path to the End step.
- Select the Create Person step, click the Properties panel, then change the input type to Build Data.
- Set constant values for Firstname, Lastname, and DOB.
9. Click Debug on the top action bar; this will save and run the flow, creating a record (row of relational data) in the Person Database Structure.
Read
Existing records need to be located, or read, ahead of performing Update or Delete actions,
Update
The Edit Person and Selective Update Person steps, once again found nested under User Defined Types > Database Structures > Person in the Flow Steps panel, may be used to update an existing record in the Person Database 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 fields) 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 data structure, use the Delete Person step, found nested under User Defined Types > Database Structures > 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.