Save my content into excel

I wanted to discuss that I am saving two things from my mail. One is ordering num second is a reason. now I want to save these things into excel. In ONE COLUMN ORDERS in the second reason. I have attached my activity.
image
image

If u need to save this data to excel

You can use add data row activitiy to add both data to datatable

Regards

Nived N :robot:

Happy Automation :relaxed::relaxed:

1 Like

@mtalha.shafiq

check below for your reference

Thanks

Before For each place Build data table Activity. Clear it out (it always has some default values) by clicking “x” on on first row and both columns. Add Column Orders (as strings) and Column Reason (as Strings). create variable for that data Table

After logs place Add data row (inside for each loop) and place in array sth like this:

{order,result}

Put this datatable variable inside properties of Add data row activity.

After for each is finished place write range with datatable variable (and of course fill worksheet name and path for workbook with workbook name).

@Yameso can you please elaborate add data row activity. I have created Data table activity and variable successfully.

Hi @mtalha.shafiq

Now in the Array row propert of add datarow, add the following

{order,result}
in the same format, as these are data u need to add to the datatable

Hope the idea helps you

Regards,
Nived N
Happy Automation

You need to place data row on the bottom of the loop. Now it would add empty values.

@Yameso @NIVED_NAMBIAR

I have declared two variables for assign activity order and reason. Now I should create two more variables for the data row table? And I am using this activity but it is giving an error.


Hi @mtalha.shafiq

Write range is used to write the updated datatable

So at the exit of loop , use write range to write the updated datatable tow hitch we are adding datarow

Regards

Nived N :robot:

Happy Automation :relaxed::relaxed:

  1. Use build Data table and create output variable of build datatable as varDT before get outlook mail message activity
    image

  2. Use add data row inside your for each email body and provide like below as values to property
    image

  3. take write range after your for each body of the email
    image

Read each step carefully and follow it…It will give you expected result…

Thanks, that what I meant:D

Add just to add: that build data table should be on the beginning of sequence, before for each ( not inside it) :wink:

@Pravin_Patil1 @Yameso @ksrinu070184
I am using activities as you asked. But variables isn’t working. I am attaching pics can you look and let me know what’s the error from my side.


@mtalha.shafiq varDT is variable of type Datatable change it from string Data table…

Also you have taken wrong write range…You have to take the write range which comes under wrokbook…
image

@Pravin_Patil1 It’s running now. Thanks. It’s creating a sheet as well in excel but I couldn’t get the order and reason on the sheet. PFA ss


You need to add mentioned code after reading the email values…
After assigning result in below screenshot(Same screenshot shared by you at the start)

If still you are not getting anything mean there are no values in your variables…

@Pravin_Patil1 It’s running successfully now. Now I want to confirm one thing that we are giving path starting from “A1” how it will write 2nd order? as we have one order on A1 already

It will keep adding the data automatically and write the updated table at the end…

If you want to add the data in multiple range then use append range…

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