Adding DataRow in between of datatable -- Help

Hi, I have an excel sheet in which I have to add one row in second position with values,
How can i achieve this! Please Help
TestSS:-
image
output should be:
image
I don’t want to add 2nd row in start, After execution of whole process, at last I have to append this row at 2nd position and set value.

Please give any suggestions!

Hi @Anjali_Rani

Please create a datarow variable & create a sequence ,inside that sequence
Datarow_var= ExistingDatatable.NewRow
Datarow_var(“Datatable Column name”)=“Value want not insert”
then use invoke code activity
create two arguments for datatable,datarow
inside the invoke code activity
In_datatable_var.Rows.InsertAt(In_datarow,0)

Thanks,

I am not getting properly, can you help me with screenshot if possible

Hi @Anjali_Rani

PFA xaml file try out this

Thanks,test.xaml (7.4 KB)

1 Like

Hi @Anjali_Rani ,

Sharing my suggestion on the question.

In the end of your work flow. use excel application scope inside use the below activity to insert blank row in the second position.

Insert / Delete rows acitivity → insert values in the parameters No Rows = 1,

Position = 2 , Change mode → Add

once you create empty row → Use bulid data table activity and insert the columns and your values you want insert in the second row the output of the build data table activity is datatable with the values you mentioned in the screenshot.

Use write range activity and assign the Data table whiich you got from build data table and enter Range “B1” and uncheck the add data headers.

the above flow will help what you want. thanks

1 Like

You may check this out to do it in a dynamic way: ExpoHub Demo.zip (10.2 KB)

Thank you. This worked. :slight_smile:

1 Like

Thank you. :slight_smile:

Your welcome.

1 Like

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