Assignment 1 - assign fault

Hello,

I am trying to complete the assignment but i stuck upon this “Assign Fault” error, which stops the code from working, and I cannot figure out why.
image

WIList is DataRow
WIDataTable is DataTable
Assignment syntax is WIDataTable.Select(“Type=‘WI5’ AND Status=‘Open’”)
ExtractData ExtractMetadata syntax is “extract-table get_columns_name=‘1’ get_empty_columns=‘0’ /”

similar topic(but didnt help): https://forum.uipath.com/t/calculate-client-security-hash-assign-fault/23567

Thanks.

Do make sure that WIData table has the data. Also you can assign the value to WIList in the workflow itself. And in this case have you used an Out argument to get the data from ExtractData.xaml workflow?

@ptanas1

Before going to process further first check
If(WIDataTable.Select(“Type=‘WI5’ And Status =‘Open’”).ToArray.Count>0 )
Then
Assign

Ok, so i’ve cheked and WIDataTable has no Data, because data scraping returns no data for some reason, even though it recognizes the table, and goes though all the pages.

Extract Structured Table is auto generated, Selector is “webctrl tag=‘TABLE’ /”

Hello @ptanas1

Are you using the argument directly as the output of the data scraping?
If yes, try using a variable there with default value New System.Data.DataTable, then assign this variable to the out_WIData argument.

It worked, thanks!
I did indeed use the argument as output,
I created a variable temp with the upper mentioned default value, and then assigned it to the argument.
May I ask why it doesn’t work without default value?

Thanks again.

If you don’t initialize a variable it will take its default value, in case of value types like String, Integer it’ll work even if you do not assign in some initial value, but Arrays, DataTables, lists, dictionaries need to be given a initializaton value as default to avoid such an error! :slight_smile:

I hope you found this useful.

Cheers

1 Like