Database Structure CRUD Actions
  • 20 May 2022
  • 1 Minute to read
  • Dark
    Light
  This documentation version is deprecated, please click here for the latest version.

Database Structure CRUD Actions

  • Dark
    Light

Article summary

Overview

This article will review the use of Create, Read, Update, and Delete (CRUD) actions, via Flow steps, for Database Structures.

CRUD Action Steps: Database Structures
These steps generally DO NOT appear in Steps Panel search results but can be found by navigating to the User Defined Types > Database Structures category.

Preparation 

Create a Database Structure with applicable attributes, such as the Person example below:

Person
FirstnameString
LastnameString
DOBDate time

Create 

To create a record in the Person data structure:

  1. Create a Flow; find and select the Steps panel.
  2. Expand the User Defined Types category.
  3. Expand the nested Database Structure category.
  4. Expand the Person data structure.
  5. Drag the Create Person step onto the Flow canvas.
  6. Connect the Start path to the Create Person step; drag the step's Done path to the End step.
  7. Select the Create Person step, click the Properties panel, then change the input type to Build Data.
  8. 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.

Auto ID Generation
Despite being initially set to Ignore, note how Decisions auto-generates the record's ID upon creation by the Debug (Flow run) action.


Read

Existing records need to be located, or read, ahead of performing Update or Delete actions,

Fetch Entities Step
The Fetch Entities step finds records by desired attribute and outputs the corresponding record Id.

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 vs Selective Update
  • 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.



Was this article helpful?