12-03-2022 05:26 AM
Hi there,
I have a schema like this
in which the data looks like below
Basically, I am making an API call to insert order Line, and as they are getting inserted, the response result is bringing back the records.
starts with 1 then based on the number on the number of requests, the response brings back all the inserted ones, repeating previously inserted ones.
respose1
{
1
}
respose2
{
1,
2
}
respose3
{
1,
2,
3
}
my goal is to get distinct inserted records
as
Order-Lines : [
{
1,
2,
3
}
]
please find here the sample input for more understanding.
any guidance is greatly appreciated.
Thanks
Manohar
Solved! Go to Solution.
12-04-2022 10:28 AM
Hi @manohar,
Here is an updated pipeline.
Community_2022_12_04.slp (1.7 MB)
I’ve made two samples. First one is with the all other data included from the response and second one is only with order lines. See which will work for you more.
If it’s still something as you not expect tell me I am here to help.
Regards,
Viktor
12-03-2022 05:21 PM
Hi @manohar
There are several ways from which you can get the correct order line. Here are two of them.
$['order-line'][$['order-line'].length-1]
$['order-line'].pop()
You can always pull out last element of the array.
Regards,
Viktor
12-04-2022 09:10 AM
Thanks @viktor_n for the direction.
I have tried multiple ways but did not see how to get it. please see attached pipeline that I have tried.
Community_2022_12_04.slp (877.8 KB)
please advice what I am missing.
Thanks
Manohar
12-04-2022 10:28 AM
Hi @manohar,
Here is an updated pipeline.
Community_2022_12_04.slp (1.7 MB)
I’ve made two samples. First one is with the all other data included from the response and second one is only with order lines. See which will work for you more.
If it’s still something as you not expect tell me I am here to help.
Regards,
Viktor
12-04-2022 06:07 PM