Issue with Invoke Workflow out argument

Hello,

I have a issue with an invoked workflow. This one have two arguments, one as “In” another as “Out” and my problem is with this last.

This argument is typed as “ICollection” as I show below:

When I try to add a string to this collection using the “Add to Collection” activity and run this project I receive this error: “The property ‘Collection’ of ‘Add to collection’ is not initialized”

Okay I know, this error can be solved initializing an variable as new List(Of String) but it can’t be done when is a out argument.

Any ideas?

BR,

Pacheco.

Hi @rpa2512 welcome to the community!

Have you tried using a local variable to hold and manipulate that collection and have an assign to the output at the very end of the sequence?

Yes, I tried and I got the same error…

Can you share a screenshot of the properties for the Add to Collection component?

Sure!

Here the prints:



I think the only thing left is to initialize out_ordersFound. Although you can’t initialize it in the variables window, you can initialize it within the workflow. Have you tried that? (I don’t see the initialization in your screenshots).

Try using an assign at the beginning of your sequence initializing the out_ordersFound object. I don’t have my system handy to try it out and send you a screenshot, sorry.

1 Like

You mean it:

Yup! That’ll do the trick. I opened my windows machine and tried it out and that works.

1 Like

Thanks a lot Pedro, it works :smiley:

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