Insert data in Excel

Hello, How are you, I have a problem with a robot and I do not know how to solve it and I would like to ask for your help. The robot must obtain a text from the web, but first it obtains IDs from an excel and sends them to a page to see if it has judicial records or not, it captures the result and must put it in the Excel in the same row from where it took the id and in the column of al.
I do this with a for each in which it runs through the rows of a table to get the id and then send it to the page and get the result. I have tried some ways but they have not been effective.

In short I need you to help me get the text of the page and send it to the same row of the ID with which it works but in the column next to it, so kindly request that I offer your help.

Thanks for your attention.

Here is the page: https://antecedentes.policia.gov.co:7005/WebJudicial/index.xhtml

Ejemplo de cรณmo se ve el excel:

Thanks very much.

@santi4058

Try below steps:

  1. use Read Range activity to read the data from excel and store output in variable of type DataTable and say โ€˜DTโ€™.

  2. Then use ForEach Row activity to iterate the DataTable DT.

              ForEach row in DT
              int index = DT.rows.IndexOf(row)+2
    
                - use Type Into activity to enter ID value - row("ID").ToString
                - use GetText activity to read value from site and store it in a variable of type    string and say 'getDescription'
                - use Write Cell activity to write into cell and pass range and description
                   
                      Range: "C"+index.Tostring
                      Value: getDescription
    
2 Likes

Hello, Excuse me could you explain how to use the Type Into in this project and where to put it

@santi4058

For this, use Type Into activity.

How you want to pass ID from Excel to web page ?

I am already passing the Excel data to the web, I just need to enter the data obtained from the web in Excel in the same row of the identification that is being worked on.

Already as you showed me I did it, only that the data obtained by the first identification entered is inserted and transferred to all the rows that are worked.

How could I resolve that each time the cycle is traversed and I get the data from the web I insert it in the row of the identification that is being worked on and obtaining the data?

@santi4058 once you get the output from Web page using get text activity store it in variable and later use write cell activity, in that give the variable name which you have to get text. Seems like you want to write that data in column โ€˜Dโ€™. Mention same column in write cell activity, so here comes the logic to write each text in each row you have to use counter variable,
Create a counter variable with default value 2,and under write cell activity give assign activity and in value place give โ€˜โ€™ counter+1โ€™โ€™ and in to place give โ€˜โ€™ counter โ€˜โ€™ and in write cell activity in the place of column D append +counter. To string. By give this expression for each iteration it will get the text and write in each row. Hope it helps. plz Let me know if anything goes wrong

Thanks everyone for your help

1 Like

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