How to pass DataTable as an argument to the other workflow?

I have data scraped from excel into an output DataTable argument (out_dtTable) in 1.xaml file and after which I am invoking the 2.xaml file where I have assigned the input DataTabe argument(in_dtTable) to out_dtTable.

But while debugging I noticed that as I come out of 1.xaml the out_dtTable becomes NULL and it throws an exception.

How do we resolve this situation? I appreciate any inputs here. Thanks!

2 Likes

In the first Xaml dont have the datatable variable in variable sectionā€¦just have it in the argument sectionā€¦Use in/outā€¦Likewise in second Xaml as wellā€¦Have the variable in the main sequence where these workflows are usedā€¦

Also create the same argument name sin invoke workflow section

2 Likes

Hi @Sachingoudar

Did you pass the outDatatable to your created global variable before passing to another xaml?

can you share more info like posting your screenshots here.

Cheers :smiley:

Happy learning :smiley:

3 Likes

Hi @Sachingoudar!

Be sure that you created out_dtTable in 1.xaml as an argument of type ā€œOutā€. Im assuming that youll invoke this xaml in another part of your code, so u will see the ā€œedit argumentsā€ button when you use the invoke activity, inside the edit arguments you need to set a new global or local variable that will hold the content of ā€œout_dtTableā€ that you are exporting from 1.xaml. When you create this variable, the last thing you will have to do is set the ā€œin_dtTableā€ of 2.xaml receiving the variable that you create.

Hope to help.

Happy coding! =)

2 Likes

How to promote the variable to global scope? I donā€™t find the Manage Variables option on Design ribbon.

So finally I could fix this. Thank you all for the inputs. Here it isā€¦

Created one ā€˜io_dtā€™ argument of type I/O in the top Process.xaml.
Created one ā€˜io_dt1ā€™ argument in 1.xaml file.
Created one ā€˜in_dt2ā€™ argument in 2.xaml file.

Invoke both 1.xaml and 2.xaml inside Process.xaml.

While importing argument for 1.xaml assign ā€˜io_dt1ā€™=ā€˜io_dtā€™.
Then read the data from excel or scraping into ā€˜io_dt1ā€™.

Finally, import argument for 2.xaml by assigning ā€˜in_dt2ā€™ =ā€˜io_dtā€™.

That will pass on the data table from one xaml to other.

2 Likes

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