Write in specific column based on a row

hm let me explain what i am trying to do and why i need it. Then i think it will be easier for both of us.

The robot its downloading a bunch of pdf files from its mail. Then its logging all important information thats extracted from the pdf files into a excel sheet.

I am then using a invoice program that require login. Here comes the excel handy, because in the excel sheet there its a column “Avdeling” that column indicates username. So instead of loggin in and out for every singel “AVDELING” i can just look at the last value check if its the same as current value then just stay logged in ( made this work) .

The thing about the status its that the invoice program shuts down sometimes, so i would need to update the status column of that current row i am working on so i know what job went offline, was started and completed


ok. is the variable type for row index “int32”?
write like “L”+(row_index+1).ToString()

hm its not working. its just removing my column name, then when it loops back it crashes and says “Lookup Data Table: In the ‘Target Column category’ the value for argument ‘Column Name’ is not set or is invalid.”

may you provide me the workflow file + excel file itself?

yes. the workflow file has some invoke code, but thats basically for generating the excel file Main.xaml (20.9 KB) project.json (1.0 KB) 04-23-2020 PDF.xlsx (19.1 KB)

thanks for sticking through and trying tho

sure. I changed a bit and now the part where to insert the status works.

Please find attached the xaml file.Main.xaml (25.4 KB)

  1. I dont use column avdeling since there is duplicates. I use SO NR. I assume to get this from your data table EXCELLIST_PDFS. I renamed the varial pdf_avdeling to pdf_so

  2. The lookup column is SO NR from your excel file

  3. The range in write cell activity was wrong (my bad) I corrected it

With all the changes this part is working fine.

In the main file you will find the sequence insert status. simply connect it to the start and run it. I also inserted it in your for each row sequence. I overwrote the excel path :blush:

hm dont know why it dont work for me, its still writing that value into the column ( where it says STATUS)

and when i continue the loop and it goes to next row it crashes because the STATUS column has been changed and it cant find it

did you update the range in write cell activity to “L”+(row_index+2).tostring() ?

yes, so very strange

thanks for trying bro, i will try some more on my own or get a work around on it :slight_smile:

The for each row activity actually has an Index in the properties you can use if you aren’t sorting the datatable. If you assign a variable to the index, you can write to a cell using (assuming status is in A) “A”+(indexVar+2).ToString() as the cell reference. You need to add two to the index value as it always starts from zero and Excel always starts from 1, so +1 to get it to Excel rows, then +1 to avoid your headings.

I’m using the Workbook > Write Cell here instead of Excel > Write Cell, as i don’t like having to constantly open the excel file.


You just brightned my monday! U are a genius THANKS!

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