- 18 Oct 2023
- 2 Minutes to read
- Print
- DarkLight
Data Extensions
- Updated on 18 Oct 2023
- 2 Minutes to read
- Print
- DarkLight
Overview
Data Extensions serve as a way to expand the capabilities of a data structure by adding fields. These fields can be defined and passed as output data, automatically integrating them into the database or data structure. By using data extensions, users can quickly incorporate custom fields from various data sources without the need to execute a new process each time. This functionality streamlines the process of manipulating and organizing data, leading to more efficient data management and analysis.
Data extensions are particularly useful in scenarios where combining or transforming existing data fields is necessary to create new fields. This can simplify handling complex data structures and enable the creation of more comprehensive and informative datasets.
Create Data Extension
In this example, a Data Extension is being used to modify the presentation of the "Created On" field in the "Account" data structure. The Data Extension transforms the existing "Created On" date field into a new field named "Custom Created On Date Format." The purpose of this new field is to display the date in a specific format, namely "dd/MM/yyyy."
The "dd/MM/yyyy" format represents the following:
- "dd" indicates the day of the month, with a leading zero for days 1 through 9.
- "MM" signifies the month, with a leading zero for the months of January through September.
- "yyyy" denotes the year in a four-digit format.
- Navigate to System > Designers > Lookup Lists and Constants. CLICK ADD DATA EXTENSION and click CREATE.
- Select the Start step. On the Properties panel, click SHOW EDITOR.
- Under NAME, enter "Account". In the TYPE field, enter "account" and select Account [DecisionsFramework..]. Click Save and close the window.
- Add a Create Data step to the Start and End steps. In the Properties panel, click SHOW EDITOR under the DATA category.
- Enter "CustomCreatedOnDateForm" under NAME, and leave the Type as String.
- Select the pencil icon under INPUT, and change the mapping from Constant to Merge Plain Text. Click SHOW EDITOR.
- Expand the Account data category in the Merge Text Editor window and add Account > CreatedOnDate > Day, Account > CreatedOnDate > Month, Account > CreatedOnDate > Year, each separated with a forward slash. Click SAVE.
- Click DONE. Click Save and close the window.
- Select the End step. Under Pick from Current Data, select CustomCreatedOnDateFormat. Click Save to save changes and close the Flow.
Utilizing Data Extension
- Create a new Flow.
- Connect a Fetch Entities step to the Start step. Select Account [DecisionsFramework..] on the Properties panel as the Type Name.
- For example purposes, we are setting Limit Results to 1; this is solely to show the data within Data Extension is available to use within a Flow.
- Attach a Create Data to the Results path. In the Properties panel, select SHOW EDITOR under Data > Data to Create and enter "NewDateFomat".
- Under INPUTS, change the mapping to Select From Flow. In the Pick Data window, expand Entity Results, select All CustomCreatedOnDateFormat, and select First. Click DONE.
- Connect the Done path to the End step. Click Save to save changes to the Flow.
- On the top action bar, click Debug. Click START DEBUGGING.
- Select the Create Data step, select Execution 1, and select View Input/Output Data. The value displayed will display the Created On Date formatted as dd/MM/yyyy. An OldDateFormat was added to the Create Data step to showcase the difference between the new and out-of-the-box Date formats.