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.