- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
14-07-22 07:26 AM
Do we have any action or code stage to Remove Null/Empty Columns from a Collection.
@devneetmohanty07. Any insights here.
------------------------------
vinod chinthakindi
------------------------------
Answered! Go to Answer.
Helpful Answers
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
19-07-22 08:20 AM
Dim bRemove as Boolean
Dim iColumn as integer
' Loop through each column
For iColumn = Collection_In.Columns.Count - 1 to 0 step -1
'For each Row as DataRow in Collection_In.Rows
bRemove=True
' Loop through every row for this column
For each Row as DataRow in Collection_In.Rows
if Trim(Row(iColumn).ToString()) & "" <> "" then
bRemove=False
exit for
end if
Next
if bRemove=True then
Collection_In.Columns.Remove(Collection_In.Columns(iColumn))
end if
Next
Collection_Out = Collection_In.Copy
It's VB code. For Code Properties settings:
* Inputs, a collection named "Collection In"
* Outputs, "Collection out".
Please note, the code above works only for Collection having String fields only. Please develop further if your Collection contains Flags, Numbers etc. It's basically a fork of "Remove Empty Rows" provided by Blue Prism.
Note: no guarantees given.
------------------------------
Mikko Kamppila
IT analyst
Kela
Europe/Helsinki
------------------------------
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
14-07-22 11:08 AM
Try VBO:Utility-Collection manipulation, action-remove empty rows, that should work.
------------------------------
Joshna Dammala
RPA Developer
Asia/Kolkata
------------------------------
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
18-07-22 01:31 PM
The action you have stated simply deletes Empty rows, but my requirement is to delete Empty Columns
------------------------------
vinod chinthakindi
------------------------------
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
18-07-22 04:20 PM
You can use "Delete field" action of Utility-Manipulation and provide the column name to be deleted. It will ask for field name as input to be deleted. Please let me know if it doesn't work for you.
------------------------------
Manpreet Kaur
Manager
Deloitte
------------------------------
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
19-07-22 05:58 AM
------------------------------
vinod chinthakindi
------------------------------
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
19-07-22 08:20 AM
Dim bRemove as Boolean
Dim iColumn as integer
' Loop through each column
For iColumn = Collection_In.Columns.Count - 1 to 0 step -1
'For each Row as DataRow in Collection_In.Rows
bRemove=True
' Loop through every row for this column
For each Row as DataRow in Collection_In.Rows
if Trim(Row(iColumn).ToString()) & "" <> "" then
bRemove=False
exit for
end if
Next
if bRemove=True then
Collection_In.Columns.Remove(Collection_In.Columns(iColumn))
end if
Next
Collection_Out = Collection_In.Copy
It's VB code. For Code Properties settings:
* Inputs, a collection named "Collection In"
* Outputs, "Collection out".
Please note, the code above works only for Collection having String fields only. Please develop further if your Collection contains Flags, Numbers etc. It's basically a fork of "Remove Empty Rows" provided by Blue Prism.
Note: no guarantees given.
------------------------------
Mikko Kamppila
IT analyst
Kela
Europe/Helsinki
------------------------------
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
20-07-22 03:06 PM
------------------------------
vinod chinthakindi
------------------------------
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
20-07-22 04:10 PM
By using utility- collection Manipulation and the action delete column I can able to delete only one column, but I want to delete all empty columns in collections.
