Issue with arguments - Object reference not set to an instance of an object

It doesn’t have to be called “dtWorkItems”. It’s just how I follow my own naming conventions so I know what’s an argument and what’s not an argument (i.e., a Variable). You can name that Variable in Main.xaml however you want - just make sure you’re renaming it in the Variables section of Main.xaml and that is receiving the DataTable argument (“out”) from your CreateDataTable.xaml.

Arguments are for passing variables from one workflow to another. I see you have Arguments listed in Main.xaml, which doesn’t really make sense to me, since you aren’t invoking Main.xaml anywhere in your Project (or rather, you shouldn’t be invoking Main.xaml anywhere). Main.xaml should only be receiving Arguments that are passed to Main.xaml and stored as Variables of Main.xaml. And those Variables are then passed to other workflows as Arguments.

If you want to pass variables from Main.xaml to other workflows as arguments, declare them as Variables in Main.xaml and as arguments in the Invoked Workflow.

If the variable is going into the Invoked Workflow as an argument and not coming back out of it: “In”
If the variable is going into the Invoked Workflow as an argument, being manipulated, and then coming back to Main.xaml as a variable: “In/Out”
If the variable is coming out of the Invoked Workflow, and is made in the Invoked Workflow as an argument: “Out”

1 Like