Hello!
I’m having issues adding a Data Row. I’ve been browsing other forum posts on this topic and it seems like I’m making the right moves with ArrayRow and DataTable cells. Is my DataTable “Emailscrape” suppose to be already formatted in excel prior to starting the project? I’ve already initialized it in Read Range near the top level of the flowchart.
The error is System.NullReferenceException: Object reference not set to an instance of an object.
Isn’t the data table going to be populated at the end of the flow with the Write range activity? How do I make the data table not null at the add data row activity?
I see the Range Chosen is from B1:F1, please remove this range selection and leave it as “”
Try adding the Read Range within an Excel Application Scope and execute it.
3 . Run in Debug mode and check what is the value of the DataTable after the Read Range activity
You can keep a condition after Get IMAP Messages as If GetImapEmailVariable.Count > 0, because you can’t except mails to be there, so if there is no mails then you will get the same error
Check whether in that mail folder in outlook contain atleast one mail or not. If there is no mail then your variable will hold null data and there will be exception while adding into datatable.
So please add atleast one mail in that folder in outlook then run your code in uipath.
Hello and Welcome to the forum. You need a condition before the add data row activity, your condition should check in all the variables you are trying to add to datable ant empty. Not var1.toString.isNullOrEmpty And Not var2.ToString.IsNullOrEmpty etc and then drag the add datarow activity inside so if one of the variables is empty this will not error out instead it will move to the else part.
PORT: 993
Server: “imap.gmail.com”
Sample workflow as follows. EmailAutomation.xaml (8.4 KB)
If it helps Please Mark it as a solution!!! Happy Automation
I’m not quite sure im understanding the format. Is the follow image congruent to what you said? I’ve also tried String.IsNullOrEmpty(mail.Body.ToString) and I didn’t get a warning but didnt work
I think i did everything. configure IMAP settings, allow less secure apps, and nested the read range. I’m using my University gmail account do you think that could be the problem?emailscrapingTemplate.zip (6.8 KB)
I’m still not getting emails to populate my data table. I think it might be because I’m using my school email. Do you see anything in the video that might cause the issue?