cancel
Showing results for 
Search instead for 
Did you mean: 

Alternative for group by Field snap in Ultra task

Richard
New Contributor III

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.

6 REPLIES 6

bojanvelevski
Valued Contributor

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.

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.

If that’s the case, than you can do the workaround with Pipeline Execute

Regards,
Bojan

ptaylor
Employee
Employee

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?