Postman flows - GET List Order with Multiple Line Items

Hi Everyone,
i have managed to create a flow that Pulls Order Information that contains line items, i have managed to iterate thru the list of items in order to try and PUT (Create) 2 new order in second call but all the line items are getting grouped, example:
Order1
OrderNBR
CustomerID
Details[Item1,Item2,Item3],

Order2
OrderNbr
CustomerID
Details[ Item4,Item5 ]

Results of FOR EACH Items Details

Order1
OrderNBR
CustomerID
Details[Item1,Item2,Item3,Item4,Item5],

Order2
OrderNbr
CustomerID
Details[ Item1,Item2,Item3,Item4,Item5 ]

How can i keep the line items per order separate?

Hi @roger.urbina !

I’ve filed a bug for this behavior and our engineering team is looking into it.

In the meantime this can be accomplished in another way:

Remove the For <> Collect loop and use the below code instead and it should give you what you’re trying to achieve. It uses an FQL function Map that applies a transformation to every element in a list.

Here’s the code inside the Evaluate block in text:

$map(details, fn($e){{"InventoryID": {"value": $e.InventoryID.value}, "OrderQty": {"value": $e.OrderQty.value}}} )

Let me know if you run into any issues and we can move this to DM and try to resolve it on a call.

Daniel

Thank you @flows-daniel that solved my requirement,

does that mean that the for each loop is not working correctly and my initial approach was correct ?

Hey @roger.urbina , yeah the nested for has some bug which is causing a caching issue. Will debug and fix it soon. Thanks for bringing it to our attention.

2 Likes

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.