- 24 Jun 2022
- 2 Minutes to read
- Print
- DarkLight
Creating Defined Data Structures
- Updated on 24 Jun 2022
- 2 Minutes to read
- Print
- DarkLight
Overview
Defined Data Structures represent information that can be thought of as variables belonging to the object they represent. By utilizing 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 be used to extend an existing type, create a custom type subclass, or create a subtype, custom .dll. They can be stored in a Database. Not storing it in a Database means the data won't persist. This can be useful to build a partial object and use it in a Flow without saving these intermediary objects. This Data Structure doesn't take action against it; it needs some other component to generate it or perform a method on it.
Defined Data Structures can be created in the Folder System > Designers > Data Structures.
Example
In this example, create a Defined Data Structure and add data fields to the Data Structure with String, Boolean, Integer, and Date Time Data Types. Then, set how the Data Structure can be saved.
This example Data Structure will be called "UserInfo" and will contain variables of demographic information not already represented by User Accounts, including First and Last Name, Address, Sex, Age, and IsEmployed; this can be helpful for tracking/storing additional information about users besides the preconfigured data fields in the Account Data Structure.
Data Structures are contained in the Folder System > Designers > Data Structures. Some Structures are common variables available to a programmer like integers, bytes, Boolean, strings, and others. These structures appear throughout much of the platform and have no members. In fact, they are the Data Structures typically used as members for more complex structures.
At least two of these Data Structures, commonly referred to as Composite Structures, are already defined: Decisions and DecisionFramework. These Data Structures are like custom structures. They rely upon data fields to define their properties. The key here is that Data Structures can be nested inside each other. This allows users to create Data Structures of nearly unlimited complexity.
- To begin building the example Data Structure within a Designer Folder, select the button CREATE DATATYPES/INTEGRATION.
A Custom Data Structure has only a few components: a Name, a Namespace and Super Class (or Parent Class), data fields, and an option for storage.
- Begin by naming the Custom Data Structure "UserInfo" and assigning its Members. This will determine what information is collected and represented by the Data Structure.
- Enter a name in the Structure Type Name field.
- Create three String type data fields called FirstName, LastName, and Address.
- The next data field, IsEmployed, is a little different. To change the Data Type to Boolean, select the data field Type selector, then select the Data Type from the list.
- For Age, restrict the variable's value to whole numbers only utilizing an Int32 type.
- The final data field, DateOfBirth, must be a valid calendar date. Choose the Date Time type.
- By default the Defined Data Structure is set as NoDatabaseStored; to change this option select DatabaseStored from the Storage Option drop down list.
- SAVE to save the Custom Data Structure.For more information on storing records in the Data Structure, refer to Defined Data Structure CRUD Actions.The Super Class setting for a Defined Data Structure is used for Data inheritance. For more information, reference Super Classes and Sub Classes.
- This completes the creation of the Custom Data Structure. It now appears in the list of available Data Structures and can be used anywhere on the platform.
- Examine the details of the Data Structure. Notice it contains the data fields and Properties that were added.
- If desired/needed users have the ability to modify or even delete the Custom Data Structure.