Problem with grouping objects
I have tree xml files. Each of the files contains the same section “Workers” and another section which doesn’t have to be in another file.
I would like to group it after common section and get situation in which specific Employee contain such tags which are in diffrent files.
To be precise, I have a situation as below
I have three records, and for employee “Adam Grey” I have two records - in one record there are data for TimeOffEventGroup column and for another record there are data for LeaveRequestEventGroup ,LeaveOfAbsenceEventGroup columns.
I would like to union these two records in such a way that for “Adam Grey” I have one record and there are data fill for each of these columns.
In the attachment I will send pipline. SnapLogic_Community_RU_2019_10_22.slp (34.5 KB)
Please suggest how to solve this issue.
They are
null
because the second object in the group hasnull
values for those properties, so it is overwriting the values from the first object in the group.I would suggest moving Mapper2 in your example to the end of the pipeline and just work with the objects you already have. You can then use the
merge()
method to combine the objects in the group together. The merge will preserve the nested structure, so that the values of one object in the group don’t clobber the values in the other objects.Here’s an updated version of your example:
GroupingObjects_2019_10_22.slp (28.2 KB)