How to import Data item to Excel or CSV

gouravvishnoi

New Member
I have spy a data grid its only providing data into data item , I want to import this data into Excel/CSV file. Could you please help me ?

Fo.PNG
 
Hi @gouravvishnoi ,

If the data grid is an HTML element, then spy it using the HTML mode and use a reader stage to get all the data from the data table or data grid.
In the reader stage select "Get Table" from data drop down and store it in a collection.
Then you can write this collection to a new Excel workbook to your desired format(xlsx or csv) using the MS excel VBO.

Let me know if it helps.
 

Attachments

  • read table.PNG
    read table.PNG
    17.2 KB · Views: 159

gouravvishnoi

New Member
Hi @gouravvishnoi ,

If the data grid is an HTML element, then spy it using the HTML mode and use a reader stage to get all the data from the data table or data grid.
In the reader stage select "Get Table" from data drop down and store it in a collection.
Then you can write this collection to a new Excel workbook to your desired format(xlsx or csv) using the MS excel VBO.

Let me know if it helps.

Its a html page but when not able to spy the table, when i am selecting gettable its prompting me error as : "Internal : Failed To perform Step 1 In Read Stage 'Reader2' on page 'Action 7' - No HTML table found in GetTable call".
here i have tried all mode and options but only i can extract into data item, so i want to export this data items data into Excel/CSV.

tbl.PNG
 

gouravvishnoi

New Member
Hi @amanbareilly

its an intranet application, so not able to provide that, could you export this data item's data into excel.

_________________________________________
1. Technology : Blue Prism
Issued : 23 Jan 2017


2. Technology : Automation Anywhere
Issued : 5 Feb 2017


3. Technology : UI Path
Issued : 26 June 2017
___________________________________________

I have tried with string operation, but not able to extract.
 

RDawson9

Geek
Staff member
Hi @gouravvishnoi

This is achievable via the Text functions available in Blue Prism. I've just experimented and I've used the InStr() function to find the position of each colon in the text and then scrape everything between the colon and the next expected word (Technology or Issued). This will work as long as the format of the text stays the same. Here's what I came up with:

1516706170512.png

I start by launching the excel file and setting A1 & B1 to be the headers you mentioned - Technology and Issued. Then I begin to split out the text:

1516706272969.png

I use Colon Pos to find where the first colon exists. Then Issued Pos finds where the word "Issued" exists. I can then scrape everything between those two positions to read back the technology value. Scrape is as follows:

Trim(Mid([Text], [Colon Position]+1, ([Issued Position]-1)-[Colon Position]))

I then delete the first line of the text like so:

Right([Text], Len([Text])-([Issued Position]-1))

I'm now ready to read back the Issued Date by scraping everything between the end of the word "Issued" and the position of NewLine(). We can then repeat these steps to go back and read the rest of the values you require. You could choose to write these to the Excel file one by one or you could store them in a collection and write the collection once you're finished.


I hope this helps. As mentioned above, this process relies on the text staying in the format of:

Technology : x
Issued : y

Technology: z

Were the format to change, then the formulae would need to be changed accordingly. Please note, I realise the above process isn't complete - I was looking to explain the theory mainly.

Rob :)
 
Top