Another one on the "Calculate Client Security Hash", advanced training - Passing DataTable as an argument

Hi,

I have put the extract of the “MI5” Work Items (sequence “InitAllApplications”) in a DataTable using an Assign like this:

WIList_Filter = WIList.Select(“Type=‘WI5’ AND Status = ‘Open’”).CopyToDataTable()

So far so good.

But when it comes to proceed with the walk through of the records in the next sequence - “GetTransactionData” I have problems passing the DataTable as an argument.
Data Table arguments dont seem to have Default values?

I know that I can create the extract as Data Rows, but I’m trying to go ahead with the DataTable format.
Isn’t it possible to pass the argument as a DataTable?

If you will pass the value as a datatable you will have to change the type of the variable to datatable instead of row.
But to advice, if you do that the logic of using the framework will not be there as we process for each of the array rows that we have and pass datarow each time to be processed so that if it fails it will retry and do accordingly

Otherwise i dont really see why you will want to pass the whole table to the process and then loop and process it

Let me know what you think

Ok, thanks - I will change my solution as you suggest.

However - is it POSSIBLE to send the argument as a DataTable (the variable type is a dt).
Im curious since the field “Deafult value” is dimmed

I get no errors but the dt is null when it is picked up in the “receiving” sequence.

BR

You cannot set a default value however when you say send as argument you have to create an out dt type and then assign the argument the dt value.

Reason its not static and you will not be able to set the value(that is why you are getting null)
You will have to create dt data then send it across correct

Im now using a DataRow to store my filtered rows. Works fine in the InitAllApplications workflow and I get the filter ok
But Im still having problems PASSING these DataRows to the logic after invoking that flow

Kasta

This is the “Edit argument” section from the Invoke:
Kasta2

This Write Line doesnt get any value for WIList_Filter_AsRows2
"3. This is the number of rows I get (in Init): " & WIList_Filter_AsRows2.Count.ToString

Can anyone maybe indicate what Im missing?

BR

Inside the InitAllApplications have you assigned the value to ‘WIList_Filter_AsRows2’ out argument?
And in the workflow where you have write lines, what is WIList_Filter_AsRows2 as variable or argument?

In InitAllApplications.xaml I have this argument output:
WIList_Filter_AsRows, Out, DataRow,

and in the “Edit Arguments” in the Invoke InitApplications workflow activity I map
WIList_Filter_AsRows, Out, DataRow, WIList_Filter_AsRows2

In the workflow with the WriteLines I have “WIList_Filter_AsRows2” as a variable, DataRow and Scope is the workflow container

Im very grateful that you are taking time to help me :slightly_smiling_face:

BR

In my mind the “WIList_Filter_AsRows2” does get its value after the Invoke has taken Place.

This is fine, but have you assigned any value to it during the flow.
Can you show me where you are doing the filer condition?

Because the data is not coming out. Generally it will be available once you bind the variables

1 Like

The filtering is done in “InitAllApplications.xaml” and looks like this:

Kasta3
To: WIList_Filter_AsRows
Value: WIList.Select(“Type=‘WI5’ AND Status = ‘Open’”)

This works fine and the filtering is done

Out argument:
WIList_Filter_AsRows, Out, DataRow, Default value not supported

The invoke of the above looks like this:
Kasta4

“Edit Arguments” looks like:

My problem is that “WIList_Filter_AsRows2” doesnt get its value when its imported in the “Invoke activity”.
This is obviously because I do something wrong.

My first attempt was to pass “WIList_Filter_AsRows” but that didnt work - hence the use of “WIList_Filter_AsRows2”.

BR

Do you have a variable as well with the same name WIList_Filter_AsRows?
can you check

Yes, I do have a variable “WIList_Filter_AsRows” declared as DataRow in InitAllApplications.
Does this mean that the variable declaration takes precedence over the Assign activity in the same flow?

BR

Nope, you have an out argument and a variable both WIList_Filter_AsRows?
Then you need to remove the variable and only have the argument in use.

1 Like

Aaah, I understand!
This solved my issue - thanks a lot for all your help!
Really appreciated!

BR

1 Like

Great! :slight_smile:

[Please mark answer as solution and close the thread]

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