How to add new column data with existing data

I have one Excel (Input Excel) with one column name as “Invoice Number” so i need to add Account number also in same excel with another column.
So i am using reframework so i am extracting account number from one application after extracting I need to add the account number in Input Excel with another column.
For 1st invoice number, need to extract the account number and adding the account number in Input Excel like this…
Input file:


Output will be : like this

Note: i am using reframework template so 1st transaction i need to add one account number and 2 transaction need to add another number
.one by one …shown in the output excel .

Please help me to solve the issue.
Thanks in advance.
Regards,
Baby

the place where you want update like in middle or end of transaction or immediate after you get the account number any where is fine

follow these steps
1.use excel scope
2.use excel file
3. use find/replace activity to find cell address of invoice number by giving inv no. and column name
4.use write cell activity give the account number and cell address by replace the A with B from above output

Hope this helps

Regards

Hello @Baby123
After reading the excel file add the data column using name “Account Number” to the datatable which you read from excel. don’t put it in loop. while assigning assign as. yourDataTable.Rows(Index)(“Account Number”) = Your account number.

second solution.
Create one more table and after getting all invoice and account number add datarow in output datatable.

hope this helps.
.

Hi @Baby123

Step1: add data column Activity and–> enter the column name u wanna to add

step2: foreach activity–>enter the list variable for account number values

Step3: Inside the sequence
Assign activity

Left side:

yourDatatable.rows(0).item(“AcountNumber”)

Right side:

item/currentitem

(your for each item)

Thanks
VP

Hi @Baby123

Read the Excel file by using the “Read Range Workbook” activity and store the data in the datatable datatype variable in the first run in Initialization block. Set the datatable variable scope to globally in the Program. Use the “Add Data Column” activity to add the new column name (Account Number) to the datatable. Use “For Each row in Datatable” Activity to iterate every row in the datatable. Get the First invoice number in the loop and enter in the webpage and extract the data (Account Number) .After extracting data you can add the account number to the datatable by using “Add Data Row” Activity. After storing all account numbers to the “Account Number” column in the datatable in Process Transaction block. Write the data in the datatable variable to the output excel file by using “Write range Workbook” activity in the End process block.

Hope it helps!!

@Baby123

As you are using re framework i hope for each transaction you are getting one row

So add a new argument in_Transactionnumber to process.xaml and link the variable from main which contains the transaction number value, after extracting the data you can use write cell activity and give cell range as "B" + i(n_TransactionNumber+1).ToString

This will ensure that the data is added for each row

Hope this helps

Cheers