Skip to content

Tutorial 2 - Advanced Features

Welcome to the advanced usage tutorial of DataMaker

In the previous tutorial, we covered the process of generating a basic data set from scratch. However, there are occasions when we require more complex data structures or ones that already exist. In this tutorial, we will explore the utilization of advanced functionalities offered by DataMaker. As a prerequisite, we will need a JSON or CSV file. You have the option to either create your own file or use the provided one, which is available for download. Click the link, and once opened you’ll see a “Save” tab in the upper left corner.

What you will learn:

  • How to create a template from a file
  • Utilize custom data types for tailored data fields
  • Employ mapped and derived data types for interconnected data
  • Generate data fields with AI prompts for precision
  • Form complex templates with nested fields and templates
  • Dynamically modify templates for specific requirements

Creating a template from a file

You don’t need to start from scratch to create a template; if you already possess a JSON or CSV file with the anticipated structure, you can use that as a basis. Add a new template and name it e.g. “Products”. Click on the ellipsis button next to the save button and select “Analyze Dataset” option. Analyze Dataset1

The “Select a data source” dialog appears. Opt for JSON as the data source format (or another appropriate format if you use your own file). Upload the downloaded “Products.json” file using drag and drop or locate and select it in the file system. Alternatively, locate and select your custom JSON or CSV file, and proceed to open it. Analyze Dataset2

The template will be auto-populated with fields: “Product Name”, “Price” and “Currency Name” with the correct data types. Our remaining task is only to adjust the range and precision specifically for the “Price” field. Analyze Dataset3

Click on the green button with an arrow located to the left side of “Price” field name. Subsequently, set minimum to 0, maximum to 15 and precision to 0,01. Analyze Dataset4

Now save the template. You have just created a new template using a file stored on your computer.

Using custom data type

A custom data type enables the creation of a field with predetermined values.

We will explore, how to effectively utilize it. In our template “Products”, we will add new field called “Inventory Status” with the data type “Custom”. This option requires input of specific values, which will be chosen during the field generation process. We will fill values: “in stock”, “ordered” and “sold out” separated by commas. Afterward, we will click on the settings button located to the right of it. Within the opened dialog window, we will choose a representation for the values where the cumulative sum equals 100 percent and save. Custom Data Type1

The “Inventory Status” field will be populated with predefined values, which we can review in the live preview column on the right. Custom Data Type2

Utilizing mapped and derived data types

Mapped and Derived Data Types come in handy when establishing connections between values across different fields. At first, we will create a new field “Offer Status” with a “Mapped” data type, linking it to the “Inventory Status” field. The remapping process will be conducted within a dialog that appears after clicking on the purple settings button. We will pair the values “in stock” and “offered” with offer status “available” and the value “sold out” will be associate with the value “inactive”.
Mapped Data Type1

Upon saving, you will notice the updates reflected in the live preview column, illustrating the interdependence of values in the “Offer Status” field on the “Inventory Status”. We can establish another form of dependency between a field, or multiple fields, and a field using a derived data type. We will prepare a new field “Department” with a “Department” data type. We will select the “Text Casing” option from the menu accessed by clicking on ellipsis button, set to Lowercase, and save. Mapped Data Type2

We will demonstrate derived data type on the newly created “E-mail” field, where we will define the data type and set a value as follows: “{{Department}}”. In the live preview, the “E-mail” will reflect the value of the “Department” field for each respective item. Mapped Data Type3

Generating data fields with AI prompt

The “AI” data type enhances our capacity to generate data with a higher degree of specificity, aligning more closely with our current needs. Let’s illustrate this with a different scenario. We will create a new field called “Material” with data type “AI”. We can experiment with our prompts. Entering “material” will yield valid results, but we can also unleash our creativity by specifying materials such as plastic, wood, fabric, or their combinations. The possibilities are limitless. Explore the generated values in the live preview or obtain more results in the export data preview. If you are unfamiliar with the process refer to Tutorial 1: Basic usage for guidance. We will complete our task by entering the prompt “construction materials”. AI Prompt

Forming templates with nested fields and templates

The complexity of data structures often arises as individual fields branch out into more intricate arrangements. DataMaker offers a solution in the form of Nested Data Type. We’ll explore how to utilize this feature by creating a new template named “Suppliers.” In this template, we’ll introduce a new field called “Company Name” with the data type set to “Last Name”. Additionally, we’ll incorporate a field “Contact” with the data type set to “Nested”, considering the need for multiple addresses associated with each supplier.
Nested Fields1

In the “Contact” field we will establish nested fields “Headquarters” and “Factories”. Within the “Headquarters” field we will include “Headquarters Address” with the “Address” data type and “Headquarters Phone” with the “Phone Number” data type. Nested Fields2

Similarly, we will extend the “Factory” field. Anticipating multiple plant locations, we will configure the quantity of nested fields to be 2. We can choose to organize them in an array by setting the value to “true”. This allows us to flexibly expand the structure based on our requirements. Nested Fields3

However, the process doesn’t conclude there. We have the option to employ the newly created template and integrate it into our “Product” template, establishing a “table in table” structure. This comes into play when we introduce a new field named “Supplier” within the “Product” template, choose the “Template” data type and set “templateId” as “Suppliers”. In doing so, we have constructed a sophisticated data structure, incorporating nested fields and a template within a template. Nested Fields4

Dynamically modifying templates

Efficient data generation and easy reusability are essential for effective work. AI becomes invaluable in scenarios where country specific data is required. With just a few clicks, we can adapt our template within the DataMaker application to align with local names or data formats. To achieve this, we initiate the process by accessing the AI Prompt section, selecting one of our templates (“Suppliers” template in our current example), and specifying the number of Data Points. We then formulate our prompt to a desired arrangement like: ‘Modify Phone Number Data Type to format: “+43 # ### ####”’. Clicking on the “Run Prompt” button triggers the generation of the modified template, with results promptly displayed in preview on the right side. If satisfied with the outcome, one can choose to “Save as Modification” or “Export” the data immediately.
Modify Template Dynamically1

When we “Save as Modification”, the adjusted template will appear in the template list with a “(Modified)” suffix. The name is customizable and can be changed to suit our preferences whenever we access the template. Modify Template Dynamically2

In this tutorial, we demonstrated how to utilize our own data to craft a template and employing diverse data types for personalized customization. Additionally, we explored the option of employing AI for modifications, a valuable resource for generating akin data across various scenarios.