When i try to import data table by using For each row, an error message is displaying as For Each Row: Object reference not set to an instance of an object.
The scenario is to add the data table as quueue item.
Also Item Information is added as the same path in config.
Let me know if there any arguments or variables that i need to check.
Usually I encounter this if the datatable is null. Try to initialize your datatable variable to “New Datatable” and make sure that your dt has content.
Welcome to UiPath Community!
Can you verify if the dt_workitems has some rows?
@Htwe_Ko_Ko_Wynn use below in condition
row(“Type”).Equals(“WI4”) and row(“Status”).Equals(“Open”)
Welcome to uipath community
Before this for each row loop use a writeline activity and mention the input string like this
This will display and helps us in validating whether the datatable has any records in it or not
If it’s there then we won’t face this issue
If it has no records then we need to check whether the variable passed as input if is obtained from a argument, it should be set with proper direction like IN or OUT
If it’s obtained inside a excel application scope and and a read range within it then make sure that the variable is set with global scope of sequence in variable panel
May i know step by step process to perform your suggestion?
In the variable panel
For the datatable variable assign a default value as
Or if it’s a argument
Before to this for each row loop use a assign activity like this
datatable_variable = New System.Data.Datatable
But we need to clarify this like whether it has any value or not
Just what Mr.@Palaniyappan said for the initialization (default value). When the DT is initialized, this error will not appear and you can see clearly whether it entered your for-each row or not (= your dt is empty or not).
Then, recheck the place/activity where you are assigning the value for the DT - whether it indeed successfully assigned the data to it.