How to add data in new row based on column name

The Situation is

I have an excel sheet. Which has around 150 columns.

image

I want to add new row in this excel. I am adding data using “Add Data Row” Activity
image

But The Problem is
The data is getting added in starting columns ( like into column1, column2) But I want to add the data in specific columns ( like into column5, column140 )

Is there solution where we can add data using column name.

:slightly_smiling_face: :slightly_smiling_face: :slightly_smiling_face: :slightly_smiling_face: :slightly_smiling_face:

I know one bad method which is not suitable here. this only ok if we have only few number of columns.

image

image

Suppose if we need to value only in last one column ? But in this method we have to insert value in all columns.

1 Like

you can change in write range E1 in range, did you try that?

Yes as Pradeep_shiv said , write range or write cell while keeping in loop

@Tech_Guru
Lets assume you can Work on Datatable Base.
With datatablevar.newrow you will get an empty datarow within the structure of the Datatable.

Now you can Set the column values partly on the columns of your choice. Finally you add the row to the Datatable by using add datarow Activity and using the datarow instead of the the datarowarray

4 Likes

Yes am doing almost same.

As you know write range also need a datatable to insert.

image

And to make data table we need to use add data row activity.
image

:slightly_smiling_face: :slightly_smiling_face: :slightly_smiling_face: :slightly_smiling_face:

Yes we can skip starting columns using write range. But we need to enter details into more than 50 columns. And all of them not nearby. They have another column between them.

Thanks Mr @ppr

Thats what I want. Its working for me

I have attached test projects. It may help others :relaxed:
test.xaml (7.2 KB)

5 Likes

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