manohar
5 years agoContributor
Search in Array
hi there, I have data coming in these structures
source1 -
{
"@type": "array",
"order-line": [
{
"line-num": "00010",
"attachments": {
"@type": "array",
"attachment": {
"type": "AttachmentText",
"text": "Testing the Long Text Documents"
}
}
},
{
"line-num": "00020",
"attachments": {
"@type": "array",
"attachment": [
{
"type": "AttachmentText",
"text": "This is the Third time being sent.\n\nIn our continuing efforts to reduce transportation costs and increaseefficiency Clearway Energy Inc. has contracted Malark Logistics andjointly developed the following routing instructions. Please complywith the following instructions. Failure to comply will result inescalating non-compliance fees beginning at $50.00 per shipment andreaching $250 plus freight costs for subsequent violations.\n"
},
{
"type": "AttachmentText",
"text": "This is the second time being sent.\n\nIn our continuing efforts to reduce transportation costs and increaseefficiency Clearway Energy Inc. has contracted Malark Logistics andjointly developed the following routing instructions. Please complywith the following instructions. Failure to comply will result inescalating non-compliance fees beginning at $50.00 per shipment andreaching $250 plus freight costs for subsequent violations.\n"
}
]
}
}
]
}
and source2 -
{
"line-num": "00020",
"attachments": [
{
"type": "AttachmentText",
"text": "This is the second time being sent.\n\nIn our continuing efforts to reduce transportation costs and increaseefficiency Clearway Energy Inc. has contracted Malark Logistics andjointly developed the following routing instructions. Please complywith the following instructions. Failure to comply will result inescalating non-compliance fees beginning at $50.00 per shipment andreaching $250 plus freight costs for subsequent violations.\n",
"Id": null
}
]
}
how can I compare to see Source2 Atttachment.Text exists in Attachment.Text of Source1’s , where line-num is same?
Any help is greatly appreciated.
Thanks
Manohar
Hello @manohar,
You can also try this pipeline. As a result you’ll get the original payloads, and an extra boolean field for the condition stated above.
Array Comparison_2021_06_29.slp (8.7 KB)
Regards,
Bojan