How to bind data table and three variable in new excel sheet

Hi I have data in data table as mentioned in untitled attachment now I want create new excel sheet in this excel sheet data table value insert and add three column value Loss_cal,DC_cal,AO_cal as mention in untitled1 attachment.I want merge datatable and three variable in new excel sheet.How can I achieve this

I am getting data in exceldataDT now I want to add in this datatable two variable c_payloss,p_payloss in new excel sheet as attachment

@balupad14 @lakshman can you help me on this

1 Like

@Aditya10989

Do you want to add extra 3 columns to existing excel file ?

What do you mean by

Do these

represent columns in the datatable?

Cheers

as mention in above screen shot in for each row ExcelDataDT I am getting data.I have 3 variable C_payloss,p_payloss,AO_payloss.Now I want create new excel and merge 3 variable value in datatable

eg I have excel sheet with column name A,B,C,D,E and data 1,2,3,4,5 and I am getting value in this using for each row

A B C D E
1 2 3 4 5

new excel sheet will be

A B C D E C_payloss p_payloss AO_payloss
1 2 3 4 5 6 7 8

@Aditya10989

Ok understood.

  1. First create DataTable using Build DataTable activity with all 8 columns.

  2. Then use ForEach Row activity to iterate your data of 5 columns. Inside this loop, use Add DataRow activity and pass Array Row like this.

    {row(0).Tostring,row(1).Tostring,...row(4).Tostring,C_payloss.Tostring,p_payloss.Tostring,AO_payloss.Tostring}
    

And finally use Write Range activity to write into required excel file.

5 Likes

Yes. @lakshman is always at our service . just fun…

3 Likes

@balupad14

Hehe :joy::joy:

5 Likes

Yes @lakshman,
I am seeing many people are giving very good reply to the thread. You are the one of person.I appreciate you …

Regards
Balamurugan.S

3 Likes

Thanks bro @balupad14. It means a lot to me.

5 Likes

I am not seeing our other guys @Palaniyappan , @Lahiru.Fernando … :drum::drum::drum::drum:

Regards
Balamurugan.S

2 Likes

hehe here i m
bit busy with a bot development…i will be back in few mins… @balupad14

2 Likes

But you are at spot service ya .(Fun thambi):smile::smile::smile::smile:

Regards
Balamurugan.S

2 Likes

hehe
@balupad14

2 Likes

How to merge two variable value with existing data table

Hey bro @balupad14 … Sorry… I saw the message, but couldn’t reply because I got stuck with meetings… We are getting ready for the meetup… lot of things to do… That’s why I’m not much active in replying to topics this week. But I am always online over looking what is happening… After 10th, I will be fully active here as usual… I’m having a meetup practice trial tomorrow with the internal people… So have lot of preparations from my side too… it’s the first event, so it has to be good… Many Sri Lankan people here in the forum also reached out to me… I’m really looking forward to meet them live too…

2 Likes

You @Lahiru.Fernando bro. You told about the meet up. I forgot it. Wishes to enjoy the event.

Regards
Balamurugan.S

1 Like

thanks man for your help.Now I am getting this message as mention in attachment.In this I used filtert datatable outside for each loop but I did’t use build data table.So I also create build data table

1 Like

This error implies that the number of elements mentioned in the ArrayRow property is more than the actual number of columns in your datatable
Kindly check that once
Cheers @Aditya10989