- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
27-10-21 10:40 AM
I have a collection with 10+ thousands rows and I need to rename some of its values. For example: "Cancellation Type A" should be "Cancellation", and "Cancellation Type B" should be "Cancellation" too. It is important that I am not looking for az exact match, for example "[Collection.Colunm] = "Result", I am looking for partial match, such as InStr([Collection.Column] = "Result" > 0. If this is True then I have to rename the value, but if it is False, then no action necessary.
I have a working solution with a loop, but it's fairly slow with this amount of rows. That is why I have been looking for a solution to resolve this with a code stage.
I could not find a solution within "Collection Manipulation" so I am here to ask the help of the community. 🙂
Thank you in advance!
Zoli
------------------------------
Zoltán Tóth
Communication specialist
Aegon Hungary Composite Insurance Company
Europe/Gibraltar
------------------------------
Answered! Go to Answer.
Helpful Answers
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
27-10-21 12:34 PM
In order to handle it efficiently with lesser time, i would suggest you to use Excel VBO to perform Find and Replace feature and then getting back the data to collection. If you try to perform it using "Collection manipulation", it will perform record by record and hence would be very time consuming and consuming a lot of memory, thereby causing memory leakage. If you need code stage to perform the "Find and Replace" feature, i can help you with that as well.
------------------------------
Ritansh Jatwani Senior Consultant
Consultant
EY
Gurgaon
*If you find this post helpful mark it as best answer
------------------------------
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
27-10-21 12:12 PM
I haven't tried this out for 10k rows but how about converting the collection to JSON using Utility - JSON and then updating/replacing all values in JSON, before converting it back to collection.
------------------------------
Shashank Kumar
DX Integrations Partner Consultant
Blue Prism
Singapore
+6581326707
------------------------------
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
27-10-21 12:21 PM
------------------------------
John Carter
Professional Services
Blue Prism
------------------------------
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
27-10-21 12:34 PM
In order to handle it efficiently with lesser time, i would suggest you to use Excel VBO to perform Find and Replace feature and then getting back the data to collection. If you try to perform it using "Collection manipulation", it will perform record by record and hence would be very time consuming and consuming a lot of memory, thereby causing memory leakage. If you need code stage to perform the "Find and Replace" feature, i can help you with that as well.
------------------------------
Ritansh Jatwani Senior Consultant
Consultant
EY
Gurgaon
*If you find this post helpful mark it as best answer
------------------------------
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
27-10-21 01:15 PM
I have tried every other solution rather than loop stage, but writing the data to Excel and creating a pivot is almost as time consuming as the loop itself, so I am in the same position.
Help with a code stage would be nice. 🙂
Thanks,
Zoli
------------------------------
Zoltán Tóth
Communication specialist
Aegon Hungary Composite Insurance Company
Europe/Gibraltar
------------------------------
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
27-10-21 01:18 PM
Regards,
Zoli
------------------------------
Zoltán Tóth
Communication specialist
Aegon Hungary Composite Insurance Company
Europe/Gibraltar
------------------------------
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
27-10-21 02:00 PM
As Ritansh has suggested try using excel to edit the data, you can do this using the filters in excel to get a non exact match e.g. Cancellation A, Cancellation B are values in a column but if you filter the column using the text Cancellation you will get both A and B returned. There isnt anything native to blueprism that will filter the columns for you but I previously built something to do this and have included the code below. Be aware this code is to filter the columns you must first turn filters on for the row you need to filter on. (I think BP has a set filters on/off action) Once you have filtered you can use the excel actions to manipulate the rows to what you need then remove the filters.
Filter columns by criteria code - input values handle, workbookname, worksheetname, range (this is the range for the rows you want to include e.g. A1:G75), columnnumber (e.g. A is 1) criteriastring.
-------------------------------------------------------------------------------------------------------------------------------------------------------
Dim ws as Object, strList as Object
ws = GetWorksheet(handle, workbookname, worksheetname)
Try
If (criteriastring<>"") Then
strList = Split(criteriastring,",",-1)
'ColNum = ws.Range(range).Find(columnname).Column
ws.Range(range).AutoFilter(Field:=columnnumber, Criteria1:= strList, Operator:=7)
success = True
Else
success = False
message = "CriteriaString should not be blank"
End If
Catch ex as exception
success = False
message = ex.Message
End Try
Hope this helps
------------------------------
Michael ONeil
Technical Lead developer
Everis Consultancy
Europe/London
------------------------------
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
27-10-21 02:15 PM
It is almost what I need. As I mentioned above to use Excel VBO I have to write my collection into Excel, then run your code. Writing a collection into an Excel file is still very time consuming.
I am looking for a solution that can manipulate the values in my collection without using a loop or Excel VBO.
Thanks,
Zoli
------------------------------
Zoltán Tóth
Communication specialist
Aegon Hungary Composite Insurance Company
Europe/Gibraltar
------------------------------
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
27-10-21 03:11 PM
What is the source of your collection data?
------------------------------
Ritansh Jatwani Senior Consultant
Consultant
EY
Gurgaon
*If you find this post helpful mark it as best answer
------------------------------
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
27-10-21 03:18 PM
There is no way to extract it as a .csv, .xlsx. The only thing I can do is copy to clipboard and then paste it into a collection.
------------------------------
Zoltán Tóth
Communication specialist
Aegon Hungary Composite Insurance Company
Europe/Gibraltar
------------------------------
