Visual editor tool info
Request
The SaaS ETL platform had a Visual editor that allowed building a data transformation flow diagram with its tools. Each tool required a documentation page for it, the one that would provide both technical info on how exactly the tool transforms data and a couple of examples for it.
Solution
"Data merging tools" pages with "Aggregate by Values" page (for that very tool) among others.
For each tool I wrote a dedicated page that had the tool's description, parameters to set, JSON-code templates and a couple of "original stats → the tool set a certain way → the resulting stats" style examples. All such pages had the same structure and features, like a JSON-code template copy button, that made it easier to work with the tools in Visual editor.
Platform and tools used
Docs site run on a static site generator; Git, VSCode, Markdown, Mac OS image editors.
☝ Tech name: transform/keepTitle
Composable
MM Visual editor diagram node:
Description
Allows saving the entities in JC.it database, through the MM integration, by their title
s instead of id
s from the data source integration (title
values get copied into the originalId
subcolumn).
Parameters
targetField
[required] -entities
key
JSON-code templates
- MM Visual editor
[ { "targetField": "_entitiesKey_" } ]
- Full component code
{ "name": "transform/keepTitle", "params": [ { "targetField": "_entitiesKey_" } ], "comment": "any information" }
- EXAMPLES -
1. General example
There are two data sources: facebook and tiktok.
In the facebook data flow, the country
entity had been created by using the New Entities component, whereas the tiktok had the country
entity available to be collected from source initially.
So both data flows have the same meaning and titles entities before the merge point and thus there will be duplicated statistics after that point.
To avoid that, this component will combine both entities data into one country
entity after the data flows merge point.
-
The original stats
By
data_source
:data_source country country.originalId view facebook UK 94975234 5 facebook AU 23087089 3 tiktok UK 2356083 10 By
country
:country view UK 5 AU 3 UK 10 Instead of collapsing into a single row, the UK stats got separated.
-
The component’s JSON-code
To prevent such separation, the Aggregate by Values component can be used:
[ { "targetField": "country" } ]
-
The resulting stats
Bydata_source
data_source country country.originalId view facebook UK UK 5 facebook AU AU 3 tiktok UK UK 10 By
country
country view UK 15 AU 3
2. Detailed flow example
Single data source
Let’s take a look at how the single source data is saved in JC.it Core by data source module integration and loaded into the MM integration:
-
Original source data - saved in the Core,
.id
’s are assigned to all the entities inentities
group (here -campaign
)campaign.title campaign.id campaign.originalId camp_01 10 1000 camp_02 20 2000 -
In MM without Aggregate by Values:
campaign.id
gets rewritten creating new entities for this integration;campaign.originalId
copied from source integration’scampaign.id
data_source campaign.title campaign.id campaign.originalId source_01 camp_01 30 10 source_01 camp_02 40 20 -
In MM with Aggregate by Values:
campaign.id
gets rewritten creating new entities for this integration;campaign.originalId
copied from source integration’scampaign.title
data_source campaign.title campaign.id campaign.originalId source_01 camp_01 30 camp_01 source_01 camp_02 40 camp_02
Multiple data sources
What about processing two+ data sources stats? Or, for some reports, the entities
that have been added using the New Entities component and the entities
that have being collected from data source, both have same title
s. In such case, the statistics within the entities
group will get separated: both entities with same title
will be displayed due to having different originalId
s. This component will merge such same title
s entities into one by copying their (same) title
s into their originalId
s.
-
Data source 1 integration
campaign.title campaign.id campaign.originalId views camp_01 10 1000 10 camp_02 20 2000 10 -
Data source 2 integration
campaign.title campaign.id campaign.originalId views camp_01 30 10000 5 camp_02 40 20000 5 -
In MM without Aggregate by Values:
campaign.id
gets rewritten creating new entities;campaign.originalId
copied from source integration’scampaign.id
Viewing bydata_source
data_source campaign.title campaign.id campaign.originalId views source_01 camp_01 50 10 10 source_01 camp_02 60 20 10 source_02 camp_01 70 30 5 source_02 camp_02 80 40 5 Using source integration’s
id
s (10
-20
and30
-40
) asoriginalId
s here and matching the latter to source integrations’id
s, MM finds the entities one by one and loads theirtitle
s and metrics. Totally newid
s (50
-80
) are assigned to this MM integration’s new entities.
Viewing bycampaign.title
campaign.title campaign.id campaign.originalId views camp_01 50 10 10 camp_02 60 20 10 camp_01 70 30 5 camp_02 80 40 5 All the rows describe completely different entities. Hence both campaigns data got separated and stats is incorrect in all the rows.
-
In MM with Aggregate by Values:
campaign.id
gets rewritten creating new entities;campaign.originalId
copied from source integration’scampaign.title
Viewing bydata_source
data_source campaign.title campaign.id campaign.originalId views source_01 camp_01 50 camp_01 10 source_01 camp_02 60 camp_02 10 source_02 camp_01 50 camp_01 5 source_02 camp_02 60 camp_02 5 Using source integration’s
title
(camp_01
andcamp_02
) asoriginalId
here and matching the latter to source integrations’title
, MM: finds the entity, loads its metrics, assigns totally newid
s (50
-60
) to this MM integration’s new entities OR same ones - if such an entity (with sameoriginalId
andtitle
) has already been created within this integration.
Viewing bycampaign.title
campaign.title campaign.id campaign.originalId views camp_01 50 camp_01 15 camp_02 60 camp_02 15 Thanks to this component, rows that contain same campaigns data have become rows of same entities - with same
originalId
andtitle
- hence the stats could sum up, becoming correct for both campaigns.