Grouping records is a common need when analyzing or reporting data. Organizing records into logical groups often makes it easier to summarize and present data. Logical groups refer to data organized by categories such as; Date, Employee types, Book authors, Music genres, and many others.
Grouped data is formed by aggregating individual observations of a variable into groups. The frequency distribution of these groups serves as a convenient means of summarizing or analyzing the data.
In Synatic, there is a Group step to help with this task. You can group values in multiple records into a single array by grouping the records according to the values in one or more unique key fields.
This reference article will discuss the Group step to logically organize specific records in a dataset.
Adding the Group Step
In Synatic, the Group step is located in the Mapper drawer of the Steps palette. To use the Group step in your flow, you would simply select and drag it onto the desired location in the flow, and then you can configure the step.
Configuring the Group Step
The Group step only requires you to define one or more key ID Fields to identify each record uniquely.
The Group step will categorize records based on the defined ID Fields with the same value in the dataset.
ID Fields - Enter the key ID field you want to use to order the data
Field Entry Controls
These controls are indicated by icons and can assist you with adding, editing, and removing fields in the form. The icons are expanded below:
🖊 - Click to edit the current field.
⊝ - Click to remove the current field.
✔ - Click to accept a new field.
⨂ - Click to remove the field being entered.
⨁ - Click to add a new field.
</> - Click to open a code block where you can manually enter and manage Group fields using the JSON format.
▦ - Click to return to the field entry form.
Sorting the records
To use the Group step functionality, Synatic must first Sort the records. The Group step is designed to keep memory-use efficient, so we'll add the Sort step to order the data on a defined key field.
The Group step is designed to keep memory-use efficient, so use the Sort step to order the data on the key field before the Group step processes it. The data must be in sorted order for the Group step to group the data successfully.
Field - Enter the field you want to use to order the data.
Order - Click on the list selection arrow to sort the data in Ascending or Descending order.
In a typical example, the Group step would exist in a Synatic flow similar to the one shown below.
For the example below, let's assume our input record looks like the structure below. It consists of a list of ToDo records each containing a completion status.
For clarity, each record retrieved has the following structure:
"title": "delectus aut autem",
We want to group the records on the Todo list status, so we use the Completed field in the Group step configuration.
Records grouped on the same completed status
We can see the two data arrays created by the Group step, has one group of False status and the other group of the True status. You can get an idea of the data and its format. The output looks like this:
The small sample shown below of the expanded list of array items, shows only the False group of records and looks as follows:
"title": "delectus aut autem",
"title": "quis ut nam facilis et officia qui",
"title": "fugiat veniam minus",
If you compare the input and output data structures, you can see how the Group step functions. You can now add functionality in the flow to process the records further.
Advanced Mode Options
Limitations and known issues
Read more about the Field Mapper step.
Read more about the Super Mapper step.
See the Group tutorial.
Revisit the Getting Started page for a refresher.
Read more about Steps here.