cancel
Showing results for 
Search instead for 
Did you mean: 

How to sort a date in an excel column in descending order in blue prism

MarinaDutta
Level 5
Dear All,

I am new to Blue Prism. Kindly let me know how to sort a column in an excel containing different dates in descending order in Blue Prism

Thanks

------------------------------
Marina Dutta
------------------------------
4 REPLIES 4

PabloSarabia
Level 11
Hi Marina!

You need to "translate" the Excel into DataTable (C#). Then you can use a DataView(C#) to sort the data. 

Code example:
DataView dv = ft.DefaultView;
dv.Sort = "occr desc";
DataTable sortedDT = dv.ToTable();

For the "translate"... Here you have a quick guide for instaling OLE DB on your Blue Prism environment. Then you can connect to your Excel like a database. Use this link to complete your connection string https://www.connectionstrings.com/excel/

If don't want to use code, you can create a Collection connection to your Excel like a database, and the you can use the "Utility - Collection Manipulation" and then choose "Sort Collection"

Hope this helps you.


Bye 🙂


------------------------------
Pablo Sarabia
Programmer
Altamira AM
------------------------------

Dear Pablo,

Thank You very much for your answer. What I am trying to do is I have an Excel file containing a column having dates and I want to get the latest date. Attached is the Excel file for your reference. From the Column  which  is containing dates I want to get the latest dates. Attached is the example of date excel file. Can I proceed with the collection  Utility - Collection Manipulation" and then choose "Sort Collection" as you mentioned above. Can you guide me further as I am new to Blue Prism.

Thanks 
Marina


------------------------------
Marina Dutta
------------------------------

Hi Pablo,

Can I read a single column of an Excel sheet in Blue Prism. My requirement is read single column in an excel sheet and not the entire column.

Thanks and Regards,
Marina

------------------------------
Marina Dutta
------------------------------

Hi @Marina Dutta,

In Addition to @PabloSarabia , Yes you can read single column of an excel sheet in Blue Prism.

- Use MS Excel VBO with Get Worksheet Range as Collection action, where you can mention the Range of the required Column. By mentioning the start cell and end cell.
- Then you will the collection with the data.
-Then use Sort Collection action from Utility collection manipulation Business object .
24136.png


Hope it helps you.

Thanks,
​​

------------------------------
Srihari
RPA Developer
------------------------------