---
title: "Defined Data Structure CRUD Actions"
slug: "defined-data-structure-crud-actions"
tags: ["Defined Data Structure", "CRUD Actions"]
updated: 2024-08-13T17:35:59Z
published: 2024-08-13T17:35:59Z
---

> ## Documentation Index
> Fetch the complete documentation index at: https://documentation.decisions.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Defined Data Structure CRUD Actions

## Overview

Defined Data Structures represent information that can act as variables belonging to the object they represent. Using a Defined Data Structure, users are able to express or track information pertaining to each data field through a single object, rather than multiple individual ones. Defined Data Structures can also be used to extend an existing data type, create a custom type to subclass, create a subtype, or custom .dll.

CRUD Action Steps: Defined Data Structures [Advanced]In the Toolbox, **Create**, **Update**, and **Delete**steps cannot be searched for. Users will have to navigate to **USER DEFINED TYPES > DEFINED DATA STRUCTURES [ADVANCED]** to add CRUD actions to the workspace.

## [Prerequisite](https://documentation.decisions.com/v9/docs/creating-defined-data-structures-advanced)

For this tutorial, a Defined Data Structure was created with the following fields:

| **DDPerson** |
| --- |
| Firstname | String |
| Lastname | String |
| DOB | Date time |

When the Storage Option setting has been set to Database Stored, the CRUD Flow steps will be created and the Data Structure will be saved in the Decisions database. Users will not need to create a normal Folder to store the records.

Do Not Store Data In The Configuration FolderData Structures that are a part of the Decisions Entity Framework will automatically have a Configuration Folder. Do not store data within that Folder. The Configuration Folder is meant for creating Flows, Rules, and other Designer elements to enhance that custom data structure. For more information, please navigate to the [Configuration Folder](https://documentation.decisions.com/v9/docs/configuration-folder) article.

---

### Create

1. In a Designer Project, click CREATE FLOW and [create a new Flow](https://documentation.decisions.com/v9/docs/create-flows).
2. In the **Toolbox**panel, navigate to **USER DEFINED TYPES > DEFINED DATA STRUCTURES [ADVANCED] > DDPERSON** category and attach a **Create DDPerson** step to the **Start**and **End**steps.
3. On the **Properties**panel, set the mapping type of the **Item to Create** field from **Unknown**to **Build Data**.  
![](https://cdn.document360.io/6ef8bcc1-6489-4486-9ad1-83acff7e5df0/Images/Documentation/2024-08-13_13h28_39.png)
4. Set the **FirstName**, **LastName**, and **DOB**fields to **Constant**mapping and set values for each field.  
Auto-ID GenerationThe ID will be automatically created when the Flow runs even though its input value is set to Ignore.![](https://cdn.document360.io/6ef8bcc1-6489-4486-9ad1-83acff7e5df0/Images/Documentation/2024-08-13_13h29_38.png)
5. On the top action bar, click **Debug**.
6. Click START DEBUGGING. This will open the Debugger and create a record for the Defined Data Structure.

---

### Update

To update an existing record in a Defined Data Structure, use the **Edit**or **Selective Update**step. The Edit step will change every data field in the object, even if only one data field has been changed. The Selective Update step is used to change only one or more data field values and maintain the rest of the data field values. In order to change any record in a Data Structure, the **Fetch Entities** step will be required to fetch a particular record and then it will pass the Id of the record to be changed into either step.

#### Edit Step

1. In the Flow Designer, attach a **Fetch Entities** step to the **Start**step to fetch all entities in the Defined Data Structure.
2. Attach an **Edit DDPerson** step to the **Results**path. Set the **ID**field to **Select From Flow** and map in **EntityResults.First.ID**. Set Constant values to the DOB, FirstName, and LastName fields.
3. Connect the **No Results** and **Done**paths to the **End**step.If the Edit step is used to change one field, that field will update with the new value and all unchanged fields will be set to null or empty.![](https://cdn.document360.io/6ef8bcc1-6489-4486-9ad1-83acff7e5df0/Images/Documentation/2024-08-13_13h32_24.png)
4. Click Debug on the top action bar.
5. Click START DEBUGGING. The configured data record will be updated.

#### Selective Update Person step

1. On the Properties panel of the **Selective Update** step, map in EntityResults.First.ID to the ID field under the INPUTS category.
2. Under the DATA category, set the LastName field to a Constant value.  
![](https://cdn.document360.io/6ef8bcc1-6489-4486-9ad1-83acff7e5df0/Images/Documentation/2024-08-13_13h34_49.png)

### Delete

To remove records from a Data Structure, use the **Delete**step.

![](https://cdn.document360.io/6ef8bcc1-6489-4486-9ad1-83acff7e5df0/Images/Documentation/2024-08-13_13h35_35.png)

---

For further information on Data Structures, visit the [Decisions Forum](https://community.decisions.com/categories/Datastructures).
