Get Outlook Email to excel sheet

Hi There, I am trying to get my unread outlook email to a spreadsheet.
I know the problem is with “Add data row” but not sure what is wrong.
Appreciate your help.Thanks

Error message:
“message”: "Add Data Row: Input array is longer than the number of columns in this table.",
“level”: “Error”,
“logType”: “Default”,
“timeStamp”: “18:04:47”,
“fileName”: “oopermit”,
“processVersion”: “1.0.0”,
“jobId”: “94d8270c-43e4-47dd-be38-bd3799942439”,
“robotName”: “royang28@yahoo.com-attended”,
“machineId”: 651966,
“organizationUnitId”: 596273

As the error says, You must be passing a value that is greater than the defined number of columns in the table. Can you check the value that you are passing to Add Data Row? You can run it in debug mode and check.

@Ang_Weng_Fook

Can you please show us the DataTable structure of dt_angemail.

Hi @Ang_Weng_Fook ,

I do think that the Datatable variable is not Build with the Column Structure.

If so, At the Beginning, you could use a Build Datatable Activity and Define the Columns Needed like the Below way :
image

Assign the dt_angemail variable in the Datatable Property of the Build Datatable Activity.

Let us know if this doesn’t work.

Thanks for the reply.

Yes.i did follow the column structure but it doesnt work.

On The add data row activities, i left it as blank ,is this correct ?

Thanks

Thanks for the reply,Can you verify ?

Hi @Ang_Weng_Fook ,

Could you Provide us the Workflow if possible ?

Also, Could you Show us what is the Activity before Add Data Row ? Is it a Read Range Activity ?

If it is a Read Range Activity, Could you Check if you have given the same Datatable variable as that of Build Datatable Activity ?

We cannot get a full visual of the Workflow, But it should be that the Datatable dt_angemail is getting overwritten, that may be the cause of the Error, However, not really sure.

Hi SupermanPuuch
Thanks for the reply.I can only print screen as below.

image

image

@Ang_Weng_Fook ,

As we can see from the Screenshot you are overriding the dt_angemail.

Now, we would require to know what are the Columns present in Sheet Emails.Ex.

Or rather Why have you used Read Range Activity ?

Do you want to add the new data rows to the same sheet ?

Do you want to Add New Columns to the Same Sheet and Update Values?

You could also Just Check by Commenting the Read Range and see if the Add Data Row works.

Maybe you would require to provide us additional info on what you are trying to Achieve.

Hi Superman Punch,My aim is just very simple. I just want to copy the unread outlook mail to excel.

Now, we would require to know what are the Columns present in Sheet Emails.Ex.
(Ans: This is a totally blank sheet,i just name it “Emails.Ex”)

Or rather Why have you used Read Range Activity ?
(Ans: i follow the tutorial that do it)

Do you want to add the new data rows to the same sheet ?
Yes.

Do you want to Add New Columns to the Same Sheet and Update Values?
Yes.

@Ang_Weng_Fook , If this is the Case, You would not Require a Read Range at that point.

You can simply Remove it.

At the End, that is after/Out of the For Each Activity, we could use a Write Range Activity with Sheet name as "Emails.Ex" and use the dt_angemail as the Datatable variable.

Yes.Thank you for your patience
Finally i did it.
Appreciate it a lot
Superman Punch

1 Like

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.