@Derek_Xu (Derek) posted a new topic, subject "Object instance not set to reference of an object (Advanced Training Assignment 1)". It read:

   Hi, i have trouble initialising the DataRow array which filters the data table from the extraction of Workitems. I am not sure how to go about doing it.Can someone help? 
    
    HowtoInitialiseDataRowArray1920×1080 290 KB

Then @MahalingPatil said

    Check your data table

After which, @Derek_Xu (Derek) added

    Check?The datatable is extracted using the data scaping tool

@arivu96 (Arivazhagan A) replied

    HI @Derek_Xu,
    
    before assigning the value to datarow check the length and assign  
    Use if condition  
    **`dt.select("columnname='something'").length>0`**  
    if it is true assign the value.  
    if its false there is no record match in the column value.
    
    Regards,  
    Arivu

After which, @Derek_Xu (Derek) added

    Hi  
    Erm, Could you explain further? Do you mean I put the dt.select(“Type=‘WI5' and Status=‘Open'” in the if condition? Then assign the datarow array after? Before assigning to an output argument?
    
    Thanks

Then @arivu96 (Arivazhagan A) said

    Hi @Derek_Xu,
    
    Derek_Xu:
    
    > dt.select(“Type=‘WI5' and Status=‘Open'”
    
    yes, check in if condition using below condition  
    `dt.select("Type='WI5' and Status='Open'").Length>0`
    
    if its true assign the value  
    `WIList=dt.select("Type='WI5' and Status='Open'")`
    
    Regards,  
    Arivu

To which @MAHESH1 (MAHESHKUMAR JV) replied

    @Derek_Xu  
    I think your datatable dt_Wls might be null.  
    Better while creating the variable itself initialise the variable **new** **DataTable**
    
    Regards,  
    Mahesh

After which, @Pankaj.Patil (Robot Master) added

    Hello There,
    
    It seems that DataRow is not initialized. please try many times to initialize.
    
    Regards,  
    Pankaj

@g0furtherwithAI replied

    @arivu96 How do we initialize WIList? I am running into a similar issue.  
    dt populates the output in a csv but WIList doesn't produce anything.
    
    Here's a link to my post.
    
    System error at initialization: Object reference not set to an instance of an object. at Source: Anonymously Hosted DynamicMethods Assembly Help
    
    > @g0furtherwithAI The above select query expression will give result as Array of DataRow and you are trying to print it using Message Box activity and we can't print this with Message Box activity. Try like this. WI5list = dt_out.Select("Type = 'WI5' AND Status = 'Open'").CopyToDataTable The above expression will give you output as DataTable and then use Output DataTable activity and will convert DataTable into String and then use Message Box activity to print and pass that string to it…


{'source': 'discourse', 'url': 'https://forum.uipath.com/t/object-instance-not-set-to-reference-of-an-object-advanced-training-assignment-1/25720', 'title': 'Object instance not set to reference of an object (Advanced Training Assignment 1)', 'views': 1708, 'has_accepted_answer': False, 'word_count': 277, 'like_count': 0, 'reply_count': 4, 'participant_count': 6, 'posts': 9, 'tags': '', 'author': '@Derek_Xu (Derek)', 'participants': '@Derek_Xu (Derek), @MahalingPatil, @arivu96 (Arivazhagan A), @MAHESH1 (MAHESHKUMAR JV), @Pankaj.Patil (Robot Master), @g0furtherwithAI', 'image_url': ['https://global.discourse-cdn.com/uipath/optimized/2X/d/d5d24748a15ef6d977c23a297ddac3f520cf42e8_2_1024x576.jpg'], 'created_at': '2018-03-15T10:15:42.779Z', 'last_posted_at': '2019-11-05T16:10:42.048Z'}