I'm trying to get the "Resulting collection" out of a Read data step in a Business Process in order to iterate over it, but whatever I try the "Resulting collection" is null/empty when trying to access it later in BP. The "Collection of records" parameter for the step is populated with the expected number of records, but since it's an ICompositeObjectList, it can't be iterated over using an index (e.g. entityCollection[0]) which is really what I would like for this solution - using a foreach loop in code isn't ideal, as then we have to write everything in code rather than using the no code BP steps available to us.

 

I've tried many things including changing packages to not compile into a separate assembly and using the Resulting collection parameter in a subprocess BP by binding the output param to a BP param, and have even checked in the ReadDataUserTask code using Visual Studio to debug and check values, and it seems that the ResultEntityCollection ("Resulting collection") is being set correctly there, but it just doesn't seem to make it back to the Business Process. Does anyone know why this might be the case? And if there's any resolution? Currently working in 8.1.3

Like 0

Like

1 comments

To add some details to what I'm seeing, this is the Read data step:

 

This is a formula step to try to see what should be coming out of this step in the Resulting collection:

 

And this is my User Task step which takes an EntityCollection parameter:

 

Before the Formula step, the value of the "Entity collection" parameter is null, afterwards it appears in the BP trace logs as being "", so something does change - below is shown what the User Task step's Inspect looks like after it fails:

 

So the BP parameter value is "" for the EntityCollection, but it's null for passing into the User Task, and that's what we see in the User Task debugging in Visual Studio (which causes the error, as we get an "Object reference not set to an instance of an object" error when trying to use it).

 

When checking what the OOTB ReadDataUserTask code is setting to the ResultEntityCollection parameter (which is the parameter for "Resulting collection") we can see that it is correctly being passed the EntityCollection:

 

It just doesn't seem to be able to be used afterwards in the BP.

Show all comments