Append excel from column two

Hi experts,

I am trying to append my datatable to column 2 of the excel. But its getting appended from column 1. Could someone please help me with this. It’s too urgent requirement for my work.

Thanks in advance.

@Mahimahi

Use Filter Datatable and there OutputColumns

Select Remove and give the column1 name

So create another Datatable variable

This will give results without the column1

Hope this will help you

Thanks

Hi,
I am fetching data using datascraping(names column,cost column) and writing it to excel along with gettext value(number column).

I am getting output as it is highlighted in yellow colour, but I need my output which is blue colour highlighted. I have attached sample photo please check…

Thank you.

Hi

If the second row is also fetched from data scrapping then it will definitely append as exactly as in first row
So I round recommend to check once with the way data scrapping is done

Cheers @Mahimahi

@Mahimahi

You can use Add Data row activity for this

After Datascraping Assign variables

TextVariable = “12”
NamesVariable = DatatableVariable(“names”).ToString
CostVariable = DatatableVariable(“cost”).ToString

Now in Add Data Row pass these variables as an array

{TextVariable, NamesVariable, CostVariable}

Hope this will help you

Thanks

Hi @Palaniyappan,

There are namely 3columns in my output excel namely number, names and cost.
number column is fetched using gettext activity and the rest two columns(names and cost) are fetched using data scraping. The data scraping columns always varies sometimes it will be only 1column, sometimes 2columns and sometimes 3columns etc.

During my 1st iteration I get the below values.
image

During my 2nd iteration I get the below values.
image

I need my output like below.
image

Thanks.

Hi,

My header values always changes depending on the click activity which ill be performing. So I dnt think this will work in my case.

Thank you.

@Mahimahi

Okay, you can proceed with the Index also, if you are getting the values at the same position

Thanks

please check my last2nd post where I have attached stated my scenario. Could you please tell how to solve this

Fine

Then I would suggest to use add data row as the input for the columns in datatable is from two different sources
Once after writing to that final datatable then we can write that to excel with write range activity

So with add Datarow activity we can pass the value along ArrayRow property and mention the datatable to which this value has to be passed

First let’s take like your get text output variable is named as stroutput
And you get the output from data extraction as dtoutput

I m assuming you get only one row per data extraction

in that case use a Add Datarow activity and pass the value like this in ArrayRow property

{dtoutput.Rows(0)(“columnname-1”).ToString, dtoutput.Rows(0)(“columnname-2”).ToString, stroutput.ToString}

And mention datatable property as FinalDt

This finaldt is what we are going to write in excel instead of append range activity

Or

If you have multiple records from each data extraction then use a for each row activity and pass that extract datatable output as input variable here

Inside the loop use same add Datarow activity and mention the ArrayRow like this

{CurrentRow(0).ToString, CurrentRow(1).ToString, Stroutput.ToString}

0 and 1 denotes first and second column

Hope this would help you

Cheers @Mahimahi

Hi @Palaniyappan,

I will explain my scenario properly once.

  1. I am iterating using for each and clicking on each item and then am doing my datascraping where I get 2columns and 3rows.
    Next ill be doing data Transpose. So my output of transpose will be of 2rows and 3columns. So my 1st row values will be always same(names,cost).

1)find children
2)foreach{
<click_one activity>
<click_two>
–>save to excel
}

The dataScraping data under click_one will always have 2rows after datatranspose. The 1st row value will be always same with ‘n’ number of columns, only the 2nd row value changes. So I have used RemoveDataRow to delete1st row and am trying to append 2nd row.
In excel sheet Column1 will always have value from getTEXT. So when am trying to append datatable value its appending from next line. But i want it to append from column next to getText value.
I hope you understood my scenario.
Thanks.