<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Hi,
 
With using of existing… in Product Forum</title>
    <link>https://community.blueprism.com/t5/Product-Forum/How-to-delete-Empty-Columns-in-Collections/m-p/85211#M36242</link>
    <description>Hi,
&amp;nbsp;
With using of existing objects You can simply create Your own action that will delete all columns except ones that You need. My object just takes input collection and column names in text variable&amp;nbsp;(separated with dots). Then action checks columns&amp;nbsp;in&amp;nbsp;provided collection and delete in loop only those that were unmatched.
Still solution provided by amibarrett is more elegant.
&amp;nbsp;
Best regards
Michal</description>
    <pubDate>Fri, 08 Feb 2019 17:12:00 GMT</pubDate>
    <dc:creator>MichalSzumski</dc:creator>
    <dc:date>2019-02-08T17:12:00Z</dc:date>
    <item>
      <title>How to delete Empty Columns in Collections</title>
      <link>https://community.blueprism.com/t5/Product-Forum/How-to-delete-Empty-Columns-in-Collections/m-p/85209#M36240</link>
      <description>Hi All,

&amp;nbsp;

I am Working on Excel data, Copying all Excel data in to collections. Once I copied all data in to collections it is copying extra empty columns also, I want to delete column extra columns in collections. I tried business object Utility-Collection manipulation using Delete column action. By using this action I can able to delete only one column, I want to delete 3 columns.

If any one knows solution Please help me..

&amp;nbsp;

Thanks in Advance..</description>
      <pubDate>Thu, 07 Feb 2019 23:14:00 GMT</pubDate>
      <guid>https://community.blueprism.com/t5/Product-Forum/How-to-delete-Empty-Columns-in-Collections/m-p/85209#M36240</guid>
      <dc:creator>AparnaMenthum</dc:creator>
      <dc:date>2019-02-07T23:14:00Z</dc:date>
    </item>
    <item>
      <title>Found a fairly simple…</title>
      <link>https://community.blueprism.com/t5/Product-Forum/How-to-delete-Empty-Columns-in-Collections/m-p/85210#M36241</link>
      <description>Found a fairly simple approach on Stack Overflow.&amp;nbsp;https://stackoverflow.com/questions/1766902/remove-all-columns-with-no-…</description>
      <pubDate>Thu, 07 Feb 2019 23:27:00 GMT</pubDate>
      <guid>https://community.blueprism.com/t5/Product-Forum/How-to-delete-Empty-Columns-in-Collections/m-p/85210#M36241</guid>
      <dc:creator>AmiBarrett</dc:creator>
      <dc:date>2019-02-07T23:27:00Z</dc:date>
    </item>
    <item>
      <title>Hi,
 
With using of existing…</title>
      <link>https://community.blueprism.com/t5/Product-Forum/How-to-delete-Empty-Columns-in-Collections/m-p/85211#M36242</link>
      <description>Hi,
&amp;nbsp;
With using of existing objects You can simply create Your own action that will delete all columns except ones that You need. My object just takes input collection and column names in text variable&amp;nbsp;(separated with dots). Then action checks columns&amp;nbsp;in&amp;nbsp;provided collection and delete in loop only those that were unmatched.
Still solution provided by amibarrett is more elegant.
&amp;nbsp;
Best regards
Michal</description>
      <pubDate>Fri, 08 Feb 2019 17:12:00 GMT</pubDate>
      <guid>https://community.blueprism.com/t5/Product-Forum/How-to-delete-Empty-Columns-in-Collections/m-p/85211#M36242</guid>
      <dc:creator>MichalSzumski</dc:creator>
      <dc:date>2019-02-08T17:12:00Z</dc:date>
    </item>
    <item>
      <title>hi Michal, 
I was not…</title>
      <link>https://community.blueprism.com/t5/Product-Forum/How-to-delete-Empty-Columns-in-Collections/m-p/85212#M36243</link>
      <description>hi Michal,&amp;nbsp;
I was not successful in executing the code that was in the SO link. I have added all the Linq related namespaces but still could not manage to delete the empty columns. Could you share your code snippet to get this done? Thanks!</description>
      <pubDate>Tue, 19 Feb 2019 20:23:00 GMT</pubDate>
      <guid>https://community.blueprism.com/t5/Product-Forum/How-to-delete-Empty-Columns-in-Collections/m-p/85212#M36243</guid>
      <dc:creator>SivaGelli</dc:creator>
      <dc:date>2019-02-19T20:23:00Z</dc:date>
    </item>
    <item>
      <title>The biggest problem with…</title>
      <link>https://community.blueprism.com/t5/Product-Forum/How-to-delete-Empty-Columns-in-Collections/m-p/85213#M36244</link>
      <description>The biggest problem with this is that Blue Prism will not allow for nulls once it gets sent into the code stage, if the type is anything other than Text. I've commented out the else in the below code, because no cell will be set to null. (Tested in 5.0.24, but I'm assuming this applies to newer versions as well.) If you want to remove multiple non-text columns at once, then @mszumsk's solution is probably best. (Though running an action to drop a single column three consecutive times shouldn't really have an impact on performance, either.) &lt;BR /&gt;&lt;BR /&gt;
&lt;PRE class="language-csharp"&gt;DataView dv &lt;SPAN class="token operator"&gt;=&lt;/SPAN&gt; Collection&lt;SPAN class="token punctuation"&gt;.&lt;/SPAN&gt;DefaultView&lt;SPAN class="token punctuation"&gt;;&lt;/SPAN&gt; 
&lt;SPAN class="token comment" spellcheck="true"&gt;//Label to prevent 'Collection was modified' errors     &lt;/SPAN&gt;
Out&lt;SPAN class="token punctuation"&gt;:&lt;/SPAN&gt; 
&lt;SPAN class="token keyword"&gt;foreach&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;(&lt;/SPAN&gt;DataColumn col &lt;SPAN class="token keyword"&gt;in&lt;/SPAN&gt; Collection&lt;SPAN class="token punctuation"&gt;.&lt;/SPAN&gt;Columns&lt;SPAN class="token punctuation"&gt;)&lt;/SPAN&gt; &lt;SPAN class="token punctuation"&gt;{&lt;/SPAN&gt;
	&lt;SPAN class="token keyword"&gt;if&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;(&lt;/SPAN&gt;col&lt;SPAN class="token punctuation"&gt;.&lt;/SPAN&gt;DataType &lt;SPAN class="token operator"&gt;==&lt;/SPAN&gt; System&lt;SPAN class="token punctuation"&gt;.&lt;/SPAN&gt;Type&lt;SPAN class="token punctuation"&gt;.&lt;/SPAN&gt;&lt;SPAN class="token function"&gt;GetType&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;(&lt;/SPAN&gt;&lt;SPAN class="token string"&gt;""&lt;/SPAN&gt;System&lt;SPAN class="token punctuation"&gt;.&lt;/SPAN&gt;String&lt;SPAN class="token string"&gt;""&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;)&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;)&lt;/SPAN&gt;
		dv&lt;SPAN class="token punctuation"&gt;.&lt;/SPAN&gt;RowFilter &lt;SPAN class="token operator"&gt;=&lt;/SPAN&gt; col&lt;SPAN class="token punctuation"&gt;.&lt;/SPAN&gt;Caption&lt;SPAN class="token operator"&gt;+&lt;/SPAN&gt;&lt;SPAN class="token string"&gt;""&lt;/SPAN&gt; &lt;SPAN class="token operator"&gt;=&lt;/SPAN&gt;&lt;SPAN class="token string"&gt;''&lt;/SPAN&gt;&lt;SPAN class="token string"&gt;""&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;;&lt;/SPAN&gt;
	&lt;SPAN class="token comment" spellcheck="true"&gt;//else&lt;/SPAN&gt;
		&lt;SPAN class="token comment" spellcheck="true"&gt;//dv.RowFilter = col.Caption.ToString() + "" = null"";&lt;/SPAN&gt;
	&lt;SPAN class="token keyword"&gt;if&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;(&lt;/SPAN&gt;dv&lt;SPAN class="token punctuation"&gt;.&lt;/SPAN&gt;Count &lt;SPAN class="token operator"&gt;==&lt;/SPAN&gt; Collection&lt;SPAN class="token punctuation"&gt;.&lt;/SPAN&gt;Rows&lt;SPAN class="token punctuation"&gt;.&lt;/SPAN&gt;Count&lt;SPAN class="token punctuation"&gt;)&lt;/SPAN&gt;
	&lt;SPAN class="token punctuation"&gt;{&lt;/SPAN&gt;
		Collection&lt;SPAN class="token punctuation"&gt;.&lt;/SPAN&gt;Columns&lt;SPAN class="token punctuation"&gt;.&lt;/SPAN&gt;&lt;SPAN class="token function"&gt;Remove&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;(&lt;/SPAN&gt;col&lt;SPAN class="token punctuation"&gt;)&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;;&lt;/SPAN&gt;
		&lt;SPAN class="token keyword"&gt;goto&lt;/SPAN&gt; Out&lt;SPAN class="token punctuation"&gt;;&lt;/SPAN&gt;
	&lt;SPAN class="token punctuation"&gt;}&lt;/SPAN&gt;
&lt;SPAN class="token punctuation"&gt;}&lt;/SPAN&gt;
New_Collection &lt;SPAN class="token operator"&gt;=&lt;/SPAN&gt; Collection&lt;SPAN class="token punctuation"&gt;;&lt;/SPAN&gt;​&lt;/PRE&gt;</description>
      <pubDate>Wed, 20 Feb 2019 01:11:00 GMT</pubDate>
      <guid>https://community.blueprism.com/t5/Product-Forum/How-to-delete-Empty-Columns-in-Collections/m-p/85213#M36244</guid>
      <dc:creator>AmiBarrett</dc:creator>
      <dc:date>2019-02-20T01:11:00Z</dc:date>
    </item>
    <item>
      <title>Thanks amibarret!
I was…</title>
      <link>https://community.blueprism.com/t5/Product-Forum/How-to-delete-Empty-Columns-in-Collections/m-p/85214#M36245</link>
      <description>Thanks&amp;nbsp;amibarret!
I was interested in one stop solution to delete the empty columns using Code stage and, i agree that the other solutions suggested are valid and works well without hindering performance.</description>
      <pubDate>Wed, 20 Feb 2019 10:43:00 GMT</pubDate>
      <guid>https://community.blueprism.com/t5/Product-Forum/How-to-delete-Empty-Columns-in-Collections/m-p/85214#M36245</guid>
      <dc:creator>SivaGelli</dc:creator>
      <dc:date>2019-02-20T10:43:00Z</dc:date>
    </item>
    <item>
      <title>Thanks for all !!
I tried…</title>
      <link>https://community.blueprism.com/t5/Product-Forum/How-to-delete-Empty-Columns-in-Collections/m-p/85215#M36246</link>
      <description>Thanks for all !!
I tried below code, but the code stage is throwing compiler error, is there anything do I need to change the code.
Function RemoveEmptyColumns(Datatable As DataTable) As Boolean
&amp;nbsp;&amp;nbsp;&amp;nbsp; Dim mynetable As DataTable = Datatable.Copy
&amp;nbsp;&amp;nbsp;&amp;nbsp; Dim counter As Integer = mynetable.Rows.Count
&amp;nbsp;&amp;nbsp;&amp;nbsp; Dim col As DataColumn
&amp;nbsp;&amp;nbsp;&amp;nbsp; For Each col In mynetable.Columns
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Dim dr() As DataRow = mynetable.Select(col.ColumnName + "" is&amp;nbsp;&amp;nbsp; Null "")
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; If dr.Length = counter Then
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Datatable.Columns.Remove(col.ColumnName)
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Datatable.AcceptChanges()
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; End If
&amp;nbsp;&amp;nbsp;&amp;nbsp; return true
end function
Thanks !
Aparna.
&amp;nbsp;</description>
      <pubDate>Fri, 22 Feb 2019 00:00:00 GMT</pubDate>
      <guid>https://community.blueprism.com/t5/Product-Forum/How-to-delete-Empty-Columns-in-Collections/m-p/85215#M36246</guid>
      <dc:creator>AparnaMenthum</dc:creator>
      <dc:date>2019-02-22T00:00:00Z</dc:date>
    </item>
    <item>
      <title>I seem to recall that…</title>
      <link>https://community.blueprism.com/t5/Product-Forum/How-to-delete-Empty-Columns-in-Collections/m-p/85216#M36247</link>
      <description>I seem to recall that functions need to be placed within the global code section of the initialize stage. You should then be able to call RemoveEmptyColumns(Collection) in your code stage, assuming your inbound collection is named Collection.</description>
      <pubDate>Fri, 22 Feb 2019 02:02:00 GMT</pubDate>
      <guid>https://community.blueprism.com/t5/Product-Forum/How-to-delete-Empty-Columns-in-Collections/m-p/85216#M36247</guid>
      <dc:creator>AmiBarrett</dc:creator>
      <dc:date>2019-02-22T02:02:00Z</dc:date>
    </item>
    <item>
      <title>When I try to place this…</title>
      <link>https://community.blueprism.com/t5/Product-Forum/How-to-delete-Empty-Columns-in-Collections/m-p/85217#M36248</link>
      <description>When I try to place this code within the Global code section of the initialize stage, it is throwing the error.
Page: Initialise
Stage: Stage1
Type: Error
Action: Validate
Description: Compiler warning at line 12: Function 'RemoveEmptyColumns' doesn't return a value on all code paths. Are you missing a 'Return' statement?
Repairable: No
Page: Initialise
Stage: Stage1
Type: Error
Action: Validate
Description: Compiler error at line 5: 'For' must end with a matching 'Next'.
Repairable: No</description>
      <pubDate>Fri, 22 Feb 2019 03:13:00 GMT</pubDate>
      <guid>https://community.blueprism.com/t5/Product-Forum/How-to-delete-Empty-Columns-in-Collections/m-p/85217#M36248</guid>
      <dc:creator>AparnaMenthum</dc:creator>
      <dc:date>2019-02-22T03:13:00Z</dc:date>
    </item>
    <item>
      <title>Place a new line just saying…</title>
      <link>https://community.blueprism.com/t5/Product-Forum/How-to-delete-Empty-Columns-in-Collections/m-p/85218#M36249</link>
      <description>Place a new line just saying 'Next' above the End If.</description>
      <pubDate>Fri, 22 Feb 2019 03:24:00 GMT</pubDate>
      <guid>https://community.blueprism.com/t5/Product-Forum/How-to-delete-Empty-Columns-in-Collections/m-p/85218#M36249</guid>
      <dc:creator>AmiBarrett</dc:creator>
      <dc:date>2019-02-22T03:24:00Z</dc:date>
    </item>
    <item>
      <title>Placed 'Next' below the End…</title>
      <link>https://community.blueprism.com/t5/Product-Forum/How-to-delete-Empty-Columns-in-Collections/m-p/85219#M36250</link>
      <description>Placed 'Next' below the End If, It's working but how to use initialize stage in the process studio.</description>
      <pubDate>Fri, 22 Feb 2019 08:04:00 GMT</pubDate>
      <guid>https://community.blueprism.com/t5/Product-Forum/How-to-delete-Empty-Columns-in-Collections/m-p/85219#M36250</guid>
      <dc:creator>AparnaMenthum</dc:creator>
      <dc:date>2019-02-22T08:04:00Z</dc:date>
    </item>
    <item>
      <title>You don't call it like an…</title>
      <link>https://community.blueprism.com/t5/Product-Forum/How-to-delete-Empty-Columns-in-Collections/m-p/85220#M36251</link>
      <description>You don't call it like an action, it's just built in. If it compiled fine in the global code section, then you should be able to invoke the function RemoveEmptyColumns in any code stage on any action you create in that same object.</description>
      <pubDate>Fri, 22 Feb 2019 20:55:00 GMT</pubDate>
      <guid>https://community.blueprism.com/t5/Product-Forum/How-to-delete-Empty-Columns-in-Collections/m-p/85220#M36251</guid>
      <dc:creator>AmiBarrett</dc:creator>
      <dc:date>2019-02-22T20:55:00Z</dc:date>
    </item>
    <item>
      <title>Sorry @ amibarrett I am…</title>
      <link>https://community.blueprism.com/t5/Product-Forum/How-to-delete-Empty-Columns-in-Collections/m-p/85221#M36252</link>
      <description>Sorry @ amibarrett I am unable to catch your point.</description>
      <pubDate>Sat, 23 Feb 2019 00:32:00 GMT</pubDate>
      <guid>https://community.blueprism.com/t5/Product-Forum/How-to-delete-Empty-Columns-in-Collections/m-p/85221#M36252</guid>
      <dc:creator>AparnaMenthum</dc:creator>
      <dc:date>2019-02-23T00:32:00Z</dc:date>
    </item>
    <item>
      <title>If that code is in your…</title>
      <link>https://community.blueprism.com/t5/Product-Forum/How-to-delete-Empty-Columns-in-Collections/m-p/85222#M36253</link>
      <description>If that code is in your global code, you should be able to call&amp;nbsp;RemoveEmptyColumns(Collection)&amp;nbsp;in any code stage.</description>
      <pubDate>Mon, 25 Feb 2019 20:44:00 GMT</pubDate>
      <guid>https://community.blueprism.com/t5/Product-Forum/How-to-delete-Empty-Columns-in-Collections/m-p/85222#M36253</guid>
      <dc:creator>AmiBarrett</dc:creator>
      <dc:date>2019-02-25T20:44:00Z</dc:date>
    </item>
    <item>
      <title>Got it, Thank you…</title>
      <link>https://community.blueprism.com/t5/Product-Forum/How-to-delete-Empty-Columns-in-Collections/m-p/85223#M36254</link>
      <description>Got it, Thank you..@amibarrett</description>
      <pubDate>Thu, 28 Feb 2019 20:07:00 GMT</pubDate>
      <guid>https://community.blueprism.com/t5/Product-Forum/How-to-delete-Empty-Columns-in-Collections/m-p/85223#M36254</guid>
      <dc:creator>AparnaMenthum</dc:creator>
      <dc:date>2019-02-28T20:07:00Z</dc:date>
    </item>
  </channel>
</rss>

