cancel
Showing results forย 
Search instead forย 
Did you mean:ย 

Union into a lower level of the JSon Structure

eric_sou
New Contributor III

Hi there,
I am having a mapper generating a JSon structure such as a table.
I needed to have another information into it that was gathered using a union. However, the union is adding into the structure on same level. How can I add to the structure but on a lower level.

See current result:
[{, โ€ฆ}, {, โ€ฆ}, {, โ€ฆ}, {, โ€ฆ}, {, โ€ฆ}, {content:myfile\n}]
{BEGIN_DATE:2012-12-04 15:56:35, STATUS:OPEN, MAIL_STATUS:ERROR, FROM_USER:SERVICE, Account1, TO_USER:FIGUERAS, RACHEL, MESSAGE_NAME:NOTIFICATION, SUBJECT:Notification de workflow :โ€ฆ}
{BEGIN_DATE:2012-12-04 14:30:35, STATUS:OPEN, MAIL_STATUS:ERROR, FROM_USER:SERVICE, Account1, TO_USER:FIGUERAS, RACHEL, MESSAGE_NAME:NOTIFICATION, SUBJECT:Notification de workflow :โ€ฆ}
{BEGIN_DATE:2012-12-04 14:30:35, STATUS:OPEN, MAIL_STATUS:ERROR, FROM_USER:SERVICE, Account1, TO_USER:FIGUERAS, RACHEL, MESSAGE_NAME:NOTIFICATION, SUBJECT:Notification de workflow :โ€ฆ}
{BEGIN_DATE:2012-12-04 14:27:48, STATUS:OPEN, MAIL_STATUS:ERROR, FROM_USER:SERVICE, Account1, TO_USER:FIGUERAS, RACHEL, MESSAGE_NAME:NOTIFICATION, SUBJECT:Notification de workflow :โ€ฆ}
{BEGIN_DATE:2012-12-04 14:27:33, STATUS:OPEN, MAIL_STATUS:ERROR, FROM_USER:SERVICE, Account1, TO_USER:FIGUERAS, RACHEL, MESSAGE_NAME:NOTIFICATION, SUBJECT:Notification de workflow :โ€ฆ}
{content:myfile\n}

I would like the last bit being : {content:myfild\n} to be on a lower level, eg:

[
[{, โ€ฆ}, {, โ€ฆ}, {, โ€ฆ}, {, โ€ฆ}, {, โ€ฆ}], {content:myfile\n}
]

So I could use $.1 for the table filling, and still use the content bit as a variable, but not as part of the same structure.
Thanks,

3 REPLIES 3

eric_sou
New Contributor III

I think I was not clear.
Basically, I would need to Union to happen with adding a separation of level between the 2 elements unioned.

Such as:
{
field1: val1
field2: val2
}
Union to
{
content: val
}

Is generating the result as:
{
{field1: val1
field2: val2
}
{content:val}
}

So I could refer to the first part with $.1 independantly from $.2

Does this make more sense?
Thanks,

Hi Eric,
Might below pipeline help you what you are trying to achieve.
image

testJoin_2019_04_10 (1).slp (8.3 KB)

Regards,
Ajay

eric_sou
New Contributor III

Hi Ajay,
Thanks for your idea. However, this join is extending the size of the row with 2 more fields, whereas I would not like to add them carried over all the 1st generator data, as this will repeat and is useless.

The idea is more to go with Union but to separate isolated data from 1st generator and 2nd.