Hi! I am planning to loop through each row of a data table, and input the 4th column into a web textbox.
However, I encountered this error:
For Each Row in Data Table: Object reference not set to an instance of an object.
How do I solve this? I also want to view my data table, just to understand if I have imported it correctly. Thank you!!
Edit:
Thanks everyone for how to check if CleanedData contains value! I have checked it and it indeed has not been written.
How do I store the data table and use it for the browser? Does it has something to do with scope? Thanks!
Have you put the type into activity in use browser / application scope?
Also check the datatype of PN
Other way is to check content of each variable here using breakpoints and debug check if it has all the needed contents
vrdabberu
(Varunraj Dabberu)
July 19, 2023, 8:26am
3
@Hou_Paang_Soul
Pass the data table variable into an output data table activity and pass the output of the output data table activity into message box so that it helps to print the data table in message box.
Or else
Use the message box and write the syntax in that
datatablevariable.Rows.Count
Regards
1 Like
lrtetala
(Lakshman Reddy)
July 19, 2023, 8:26am
4
Hi @Hou_Paang_Soul
Before this for each row loop use a writeline activity and mention the input string like this
datatable.Rows.Count.ToString
This will display and helps us in validating whether the datatable has any records in it or not
Anil_G
(Anil Gorthi)
July 19, 2023, 8:26am
5
@Hou_Paang_Soul
Looks like the datatable is empty or null…
please check …you can open locals panel and see if there is data
cheers
Yoichi
(Yoichi)
July 19, 2023, 8:27am
6
Hi,
I guess CleanedData is null. Can you try to check content of CleanedData at Locals panel when error occurs or break point?
Regards,
Hi!
To verify that you are retrieving the data table correctly, set a breakpoint and check the contents of the data table variable with a watch
1 Like
supriya117
(Supriya Allada)
July 19, 2023, 8:41am
8
@kimjinseong
Change the Scope of that variable to the outermost scope, and make sure you don’t have two variables of same name.
The list of items value may be null for for each activity to provide object reference is null
vrdabberu
(Varunraj Dabberu)
July 19, 2023, 9:03am
10
@Hou_Paang_Soul
If you find the solution for your query please mark as solution to close the loop
Regards
Hi! I have checked that the CleanedData was indeed empty. I have put the scope to be for the whole flowchart, it is still empty.
Hi! I have checked that the CleanedData was indeed empty. I have put the scope to be for the whole flowchart, it is still empty. Thanks for pointing out the debugging process!
1 Like
system
(system)
Closed
July 23, 2023, 2:32am
13
This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.