Write in specific column based on a row

Hi i am using a for each row on a exisitnig datatable. In that excel sheet i have a column named Status i want to be able to update that cell under column status and current row as i move forward. how can i do this ?

Hi @langsem

I am using lookup data table activity.


That works quite well.

Cheers,
Timo

but how can it write anything into that cell ?

writing to column Status you need to use the write cell activity. See second activity in the screenshot.

where do u get row index ? i am trying to insert row there but its expecting a integer

its a variable you can create by clicking ctrl+k in the output field RowIndex. I use 2 because my data starts in row 2. the first two rows is header and a blank row.

that wont work for me, because it dont always starts in a specific row. Its a dynamic row

it works for dynamic content. Thats why you need to define in input the lookupvalue.

Anyway, since you are looping through the data table already you could try this.
image

If you dont want to use the name of the column you can do like this:
row.item(columnindex) = “new value”

hope that works out for you.

but will that assign acitivty do it alone ? dont i need a write range or something to update the excel ?

hm think i get what u mean, only thing its that it demands a excel app scope… and my excel sheets are different names frmo each day

That is correct.

I assume you are looping through your data table and update the column status. Once your done you use the write range to create the excel file.

If not. you need to use the lookup data table activity. With this activity you identify the row and with write cell activity you update the cell value in column status.

it gives a crash that workbook dont exist

ok. but the name of the excel file you need to handle apart from updating the column right?

So the excel file its a “log” to keep track of the robot process and also extract data along the way. There its a column called Status

. I have a for each row thats attached to current workbook. that i work my way down on, but along the way i would need to update the status column on that particualr row atleast 3-4 times

nah did not work. Says range “L” dont exist. But thats the specifici column of status

I prepared kind of a workflow:

I assume that your unique identifier in your excel file is column SO NR (no duplicates)

I use an excel application scope to read the excel file and create the data table dt_ark1.

  1. This dt_ark1 is the input

  2. The value you are looking for is SO NR as this is your unique ID. could be your queue item

  3. To check if the LookupValue is in the dt_ark1 you search for the ColumnName

  4. At last you identify the ColumnName “STATUS” you want to write the new value

Once that is done you can use write cell activity withing the excel application scope.

may you paste the value from range in write cell activity

what you mean :P?

like “L”+(row…