10-15-2021 03:41 AM
Hi,
Can somebody tell me if there is an alternative for the group by field snap? I need to use that functionality in an ultra task and I know that the group by field snap is not compatible. What I need to get at is the following:
Input:
[
{“$id”:“1”,“company”:“es”,“accountNumber”:“4351”,“productCode”:“a000000011”,“productDescription”:“prod1”,“netPrice”:0.0,“currency”:“EUR”,“resultMessage”:“”},
{“$id”:“2”,“company”:“es”,“accountNumber”:“4351”,“productCode”:“a0000021a47”,“productDescription”:“prod2”,“netPrice”:190.630,“currency”:“EUR”,“resultMessage”:“”}
}]
Target:
[{“prices”:
[{“materialCode”:“a000000011”,“unitPrice”:0.0,“currency”:“EUR”,“priceType”:“MSD Price”},
{“materialCode”:“a0000021a47”,“unitPrice”:190.630,“currency”:“EUR”,“priceType”:“MSD Price”}
}]
}]
Hope that somebody can help me?
Thanks in advanced.
10-15-2021 03:57 AM
Hey @Richard,
The Ultra Task is a one record in and one record out service. Any snap that is waiting and collecting all of the documents (Group by, Gate, Sort), will be stuck waiting for the “last document”. There is a workaround, with adding the Group by in a Pipeline execute, but that will not solve your problem if the input in the pipeline is document by document concept.
10-15-2021 04:10 AM
Hi
Thanks for your answer, just for clarity the input is generated within the ultra task, the ultra task is a REST GET task where we pull prices from our ERP and try to send it back in the result.
10-15-2021 04:22 AM
If that’s the case, than you can do the workaround with Pipeline Execute
Regards,
Bojan
10-15-2021 07:03 AM
I’d like to understand your use case better. Which field are you grouping on? In your example you just have 2 inputs becoming one output, yes? What if there are many inputs with different values for the grouping field? You’ll have many outputs. Do all become part of the response of your pipeline?