Why there is difference of the number of objects retrieved from the same database entity in same microflow?

0
I am trying to copy the list of objects from one entity to another but out of total objects only last of the objects form the list is getting added in the new list. Can anyone please help me out with this please? I want to copy the complete list. An even when i trired to retrieve the same entity list the values are coming different. I have watched the screenshots. Microflow ss:   Total number of objects in 2 same retrieve via database activities of same entity:
asked
2 answers
0

Hey Harsh!

 

Okay let me explain how your microflow is working on that case. First you do a retrieve and then you obtain I assume one order, then you create a new object and later on you add it to the list so that's why you see that the OrderStoredList has two elements. After the loop you do another retrieve and then you see a list with only one element. This is behaviour is correct. You need to understand that all database operations are done at the end of the transaction  (Microflow) so even when you see your commit before the retrieve this is not being until the end of the your microflow so when you do the retrieve, your new object is not in the db yet.

 

If you have any other question, please let me know.

 

Kind regards,

Emilio

answered
0

You can create a empty list of OrderStored and add each itarator on this. After this actions is complete, you can commit this list and then you'll have all objects on this entity.

answered