Read text from a screen and insert it into an Excel file

I have an excel file that includes some ticket information. When I run my scenario, a ticket ID is being generated in the application during the execution. I need to read that number and insert it into the column in the Excel file.
I have tried to copy the ID and paste it but it didn’t work.

Thanks!

Hi Rahul,

I use the OCR action,Read Text into a variable, to grab text. It works pretty well…you just need to configure the search area and play with the settings when it fails.

4 Likes

Hi Michal,

Thanks. Now how can I write it to excel? I tried these steps but it didn’t work.

Hi @Rahul8901,

Welcome to the Community!

In order to grab a text from a screen and use it (put it in a file), first try to use “Read Text Into a Variable” action as @Michal suggested. Put a variable name and make sure to set the “Text Area” property for it. To learn more about it, see this article.

Next, add a “Set String Variable” and define your variable name as the corresponding column name of the Excel file. Here is the format: (i.e. %Users:username%)
Then put the variable name of the “Read Text Into a Variable” action as its value.
Lastly, just add a “Write Line” action to insert the text in the Excel file.

To learn how to use MS Excel actions, see this article.

Here is a simple example:

Very useful topic! :wink:

5 Likes

Thanks for the reply @Alex. I was missing the variable step!