<?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 RE: Collection in Product Forum</title>
    <link>https://community.blueprism.com/t5/Product-Forum/Collection/m-p/50471#M5700</link>
    <description>&lt;P&gt;Hi Harish,&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;This action is not allowing me to set the column names from first row as the values are duplicates, please see the image&lt;/P&gt;&lt;BR /&gt;&lt;BR /&gt;------------------------------&lt;BR /&gt;A S&lt;BR /&gt;------------------------------&lt;BR /&gt;</description>
    <pubDate>Thu, 11 May 2023 15:32:00 GMT</pubDate>
    <dc:creator>aanchalm</dc:creator>
    <dc:date>2023-05-11T15:32:00Z</dc:date>
    <item>
      <title>Collection</title>
      <link>https://community.blueprism.com/t5/Product-Forum/Collection/m-p/50469#M5698</link>
      <description>&lt;P&gt;Hi All,&lt;BR /&gt;&lt;BR /&gt;I have a Collection, i Want to set the first row Values As Header Names but it has Duplicate values ie why it is not setting the header names, For Ex, in first row "Last Movement" is repeating again and again. How can i delete these duplicate values and set the first row as headers. Please Find the the Image Attached .&lt;BR /&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="25856.png"&gt;&lt;img src="https://community.blueprism.com/t5/image/serverpage/image-id/25989i0BCF6C3580A5D8E5/image-size/large?v=v2&amp;amp;px=999" role="button" title="25856.png" alt="25856.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;BR /&gt;&lt;BR /&gt;------------------------------&lt;BR /&gt;AS&lt;BR /&gt;------------------------------&lt;BR /&gt;</description>
      <pubDate>Thu, 11 May 2023 14:29:00 GMT</pubDate>
      <guid>https://community.blueprism.com/t5/Product-Forum/Collection/m-p/50469#M5698</guid>
      <dc:creator>aanchalm</dc:creator>
      <dc:date>2023-05-11T14:29:00Z</dc:date>
    </item>
    <item>
      <title>RE: Collection</title>
      <link>https://community.blueprism.com/t5/Product-Forum/Collection/m-p/50470#M5699</link>
      <description>&lt;P&gt;Hi ,&lt;BR /&gt;&lt;BR /&gt;you Can utilize "collection manipulation" VBO - Action "Set column names from the first row"&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="25835.png"&gt;&lt;img src="https://community.blueprism.com/t5/image/serverpage/image-id/25968i645CCF61BC56541B/image-size/large?v=v2&amp;amp;px=999" role="button" title="25835.png" alt="25835.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;BR /&gt;&lt;BR /&gt;------------------------------&lt;BR /&gt;-----------------------&lt;BR /&gt;If I answered your query. Please  mark it as the "Best Answer"&lt;BR /&gt;&lt;BR /&gt;Harish M&lt;BR /&gt;Lead developer&lt;BR /&gt;America/New_York TX&lt;BR /&gt;------------------------------&lt;BR /&gt;</description>
      <pubDate>Thu, 11 May 2023 15:20:00 GMT</pubDate>
      <guid>https://community.blueprism.com/t5/Product-Forum/Collection/m-p/50470#M5699</guid>
      <dc:creator>harish.mogulluri</dc:creator>
      <dc:date>2023-05-11T15:20:00Z</dc:date>
    </item>
    <item>
      <title>RE: Collection</title>
      <link>https://community.blueprism.com/t5/Product-Forum/Collection/m-p/50471#M5700</link>
      <description>&lt;P&gt;Hi Harish,&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;This action is not allowing me to set the column names from first row as the values are duplicates, please see the image&lt;/P&gt;&lt;BR /&gt;&lt;BR /&gt;------------------------------&lt;BR /&gt;A S&lt;BR /&gt;------------------------------&lt;BR /&gt;</description>
      <pubDate>Thu, 11 May 2023 15:32:00 GMT</pubDate>
      <guid>https://community.blueprism.com/t5/Product-Forum/Collection/m-p/50471#M5700</guid>
      <dc:creator>aanchalm</dc:creator>
      <dc:date>2023-05-11T15:32:00Z</dc:date>
    </item>
    <item>
      <title>RE: Collection</title>
      <link>https://community.blueprism.com/t5/Product-Forum/Collection/m-p/50472#M5701</link>
      <description>&lt;P&gt;Hi,&lt;BR /&gt;&lt;BR /&gt;&amp;nbsp;How are&amp;nbsp; you reading this data? May be try different approach to read the data and see whether it&amp;nbsp; is showing different result&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;
&lt;P&gt;There are multiple ways to delete it.&lt;BR /&gt;1)You can&amp;nbsp; get the column Names using COllection Manipulation VBO&amp;nbsp;&lt;BR /&gt;if the column Name contains text called "column" then delete that column&lt;BR /&gt;2) Check if the column values are empty&amp;nbsp; except the first row then delete the row ( It not idealistic but based on the data )&lt;BR /&gt;&lt;BR /&gt;Once you delete the columns then you can use Set column Name from first row action.&lt;BR /&gt;&lt;BR /&gt;Because of the dataTable or collection constraint&amp;nbsp; it is not working when you have two different columns with the same name It&lt;BR /&gt;Column Name are not case sensitive that being aid you can create some thing like COL1 and col1 but not COl1 twice.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;&lt;BR /&gt;------------------------------&lt;BR /&gt;-----------------------&lt;BR /&gt;If I answered your query. Please mark it as the "Best Answer"&lt;BR /&gt;&lt;BR /&gt;Harish M&lt;BR /&gt;Lead developer&lt;BR /&gt;America/New_York TX&lt;BR /&gt;------------------------------&lt;BR /&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 11 May 2023 16:03:00 GMT</pubDate>
      <guid>https://community.blueprism.com/t5/Product-Forum/Collection/m-p/50472#M5701</guid>
      <dc:creator>harish.mogulluri</dc:creator>
      <dc:date>2023-05-11T16:03:00Z</dc:date>
    </item>
    <item>
      <title>RE: Collection</title>
      <link>https://community.blueprism.com/t5/Product-Forum/Collection/m-p/50473#M5702</link>
      <description>&lt;P&gt;Hi,&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;I am reading this data as get worksheet as collection (fast).&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;Not using Oledb because sheet name is dynamic.&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;Also, can you please elaborate your solution, I am not getting it properly.&amp;nbsp;&lt;/P&gt;&lt;BR /&gt;&lt;BR /&gt;------------------------------&lt;BR /&gt;A S&lt;BR /&gt;------------------------------&lt;BR /&gt;</description>
      <pubDate>Thu, 11 May 2023 16:09:00 GMT</pubDate>
      <guid>https://community.blueprism.com/t5/Product-Forum/Collection/m-p/50473#M5702</guid>
      <dc:creator>aanchalm</dc:creator>
      <dc:date>2023-05-11T16:09:00Z</dc:date>
    </item>
    <item>
      <title>RE: Collection</title>
      <link>https://community.blueprism.com/t5/Product-Forum/Collection/m-p/50474#M5703</link>
      <description>&lt;P&gt;Hi &lt;A href="https://community.blueprism.com/network/profile?UserKey=5ac573e2-c74f-4510-bf20-44fe9b791b29" target="_blank" rel="noopener"&gt;A S&lt;/A&gt; - There's no need to go round about everything to get this done - this could be done in two steps&lt;STRONG&gt;&amp;nbsp;&lt;/STRONG&gt;with a custom modified code - Please see below:&lt;BR /&gt;Get worksheet as collection as you are doing to get the Data Table/Collection - Once you have the data Table ready as you showed in your query - for two of your requirements : i.e. first to delete the duplicate in column (I assume you would want to delete all the duplicate columns after the first occurrence below are the steps :&lt;BR /&gt;&lt;BR /&gt;1) Open any of your Collection Manipulation Extended Object - &lt;STRONG&gt;Create an Action : Delete Column by Duplicates&lt;/STRONG&gt; : Set Input as Collection In in the start Stage and in the Code Input, similarly create a Collection Out and set in the Output of code stage and the End stage refer below :&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="25846.png"&gt;&lt;img src="https://community.blueprism.com/t5/image/serverpage/image-id/25981iEAC7207C35DB0BE4/image-size/large?v=v2&amp;amp;px=999" role="button" title="25846.png" alt="25846.png" /&gt;&lt;/span&gt;&lt;BR /&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="25847.png"&gt;&lt;img src="https://community.blueprism.com/t5/image/serverpage/image-id/25977iCC9FE503E7952925/image-size/large?v=v2&amp;amp;px=999" role="button" title="25847.png" alt="25847.png" /&gt;&lt;/span&gt;&lt;BR /&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="25848.png"&gt;&lt;img src="https://community.blueprism.com/t5/image/serverpage/image-id/25978i180C49AA430F56CA/image-size/large?v=v2&amp;amp;px=999" role="button" title="25848.png" alt="25848.png" /&gt;&lt;/span&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;STRONG&gt;Open Code Stage :&lt;/STRONG&gt; Write the below code in the code stage -&lt;/P&gt;
&lt;DIV&gt;&lt;SPAN style="color: rgb(35, 111, 161); font-size: 10pt;"&gt;For iColumn = Collection_In.Columns.Count - 1 to 1 step -1&lt;/SPAN&gt;&lt;/DIV&gt;
&lt;DIV&gt;&lt;SPAN style="color: rgb(35, 111, 161); font-size: 10pt;"&gt; Dim colValue = Collection_In.Rows(0)(iColumn)&lt;/SPAN&gt;&lt;/DIV&gt;
&lt;DIV&gt;&lt;SPAN style="color: rgb(35, 111, 161); font-size: 10pt;"&gt; Dim duplicateCount = 0&lt;/SPAN&gt;&lt;/DIV&gt;
&lt;DIV&gt;&lt;/DIV&gt;
&lt;DIV&gt;&lt;SPAN style="color: rgb(35, 111, 161); font-size: 10pt;"&gt; For jColumn = 0 to iColumn - 1&lt;/SPAN&gt;&lt;/DIV&gt;
&lt;DIV&gt;&lt;SPAN style="color: rgb(35, 111, 161); font-size: 10pt;"&gt; If Collection_In.Rows(0)(jColumn) = colValue Then&lt;/SPAN&gt;&lt;/DIV&gt;
&lt;DIV&gt;&lt;SPAN style="color: rgb(35, 111, 161); font-size: 10pt;"&gt; duplicateCount += 1&lt;/SPAN&gt;&lt;/DIV&gt;
&lt;DIV&gt;&lt;SPAN style="color: rgb(35, 111, 161); font-size: 10pt;"&gt; End If&lt;/SPAN&gt;&lt;/DIV&gt;
&lt;DIV&gt;&lt;SPAN style="color: rgb(35, 111, 161); font-size: 10pt;"&gt; Next&lt;/SPAN&gt;&lt;/DIV&gt;
&lt;DIV&gt;&lt;/DIV&gt;
&lt;DIV&gt;&lt;SPAN style="color: rgb(35, 111, 161); font-size: 10pt;"&gt; If duplicateCount &amp;gt; 0 Then&lt;/SPAN&gt;&lt;/DIV&gt;
&lt;DIV&gt;&lt;SPAN style="color: rgb(35, 111, 161); font-size: 10pt;"&gt; Collection_In.Columns.RemoveAt(iColumn)&lt;/SPAN&gt;&lt;/DIV&gt;
&lt;DIV&gt;&lt;SPAN style="color: rgb(35, 111, 161); font-size: 10pt;"&gt; End If&lt;/SPAN&gt;&lt;/DIV&gt;
&lt;DIV&gt;&lt;SPAN style="color: rgb(35, 111, 161); font-size: 10pt;"&gt;Next&lt;/SPAN&gt;&lt;/DIV&gt;
&lt;DIV&gt;&lt;SPAN style="color: rgb(35, 111, 161); font-size: 10pt;"&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/DIV&gt;
&lt;DIV&gt;&lt;SPAN style="color: rgb(35, 111, 161); font-size: 10pt;"&gt;Collection_Out = Collection_In.Copy&lt;/SPAN&gt;&lt;/DIV&gt;
&lt;P&gt;&lt;BR /&gt;This code witll remove all the duplicates found in first row and its associated columns.&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;&lt;STRONG&gt;Step 2: Create Another customer action and rename that to Create Collection first row as Header - Follow similar steps of adding the Collection In and Collection Out as input/Output:&lt;span class="lia-inline-image-display-wrapper" image-alt="25849.png"&gt;&lt;img src="https://community.blueprism.com/t5/image/serverpage/image-id/25980i3AE88B67B2799A05/image-size/large?v=v2&amp;amp;px=999" role="button" title="25849.png" alt="25849.png" /&gt;&lt;/span&gt;&lt;BR /&gt;Open Code Stage and copy paste below code : &lt;/STRONG&gt;it will rename the Header with first row names and then remove fierst row as that should now be the header of collection&lt;BR /&gt;Add Code:&lt;/P&gt;
&lt;DIV&gt;&lt;SPAN style="color: rgb(35, 111, 161); font-size: 10pt;"&gt;Dim dt As New DataTable()&lt;/SPAN&gt;&lt;/DIV&gt;
&lt;DIV&gt;&lt;SPAN style="color: rgb(35, 111, 161); font-size: 10pt;"&gt;For Each col As DataColumn In Collection_In.Columns&lt;/SPAN&gt;&lt;/DIV&gt;
&lt;DIV&gt;&lt;SPAN style="color: rgb(35, 111, 161); font-size: 10pt;"&gt;&amp;nbsp; &amp;nbsp; dt.Columns.Add(col.ColumnName, col.DataType)&lt;/SPAN&gt;&lt;/DIV&gt;
&lt;DIV&gt;&lt;SPAN style="color: rgb(35, 111, 161); font-size: 10pt;"&gt;Next&lt;/SPAN&gt;&lt;/DIV&gt;
&lt;DIV&gt;&lt;SPAN style="color: rgb(35, 111, 161); font-size: 10pt;"&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/DIV&gt;
&lt;DIV&gt;&lt;SPAN style="color: rgb(35, 111, 161); font-size: 10pt;"&gt;For iColumn = 0 to Collection_In.Columns.Count - 1&lt;/SPAN&gt;&lt;/DIV&gt;
&lt;DIV&gt;&lt;SPAN style="color: rgb(35, 111, 161); font-size: 10pt;"&gt;&amp;nbsp; &amp;nbsp; Dim colName As String = Collection_In.Rows(0)(iColumn).ToString()&lt;/SPAN&gt;&lt;/DIV&gt;
&lt;DIV&gt;&lt;SPAN style="color: rgb(35, 111, 161); font-size: 10pt;"&gt;&amp;nbsp; &amp;nbsp; If Not String.IsNullOrEmpty(colName) Then&lt;/SPAN&gt;&lt;/DIV&gt;
&lt;DIV&gt;&lt;SPAN style="color: rgb(35, 111, 161); font-size: 10pt;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; dt.Columns(iColumn).ColumnName = colName&lt;/SPAN&gt;&lt;/DIV&gt;
&lt;DIV&gt;&lt;SPAN style="color: rgb(35, 111, 161); font-size: 10pt;"&gt;&amp;nbsp; &amp;nbsp; End If&lt;/SPAN&gt;&lt;/DIV&gt;
&lt;DIV&gt;&lt;SPAN style="color: rgb(35, 111, 161); font-size: 10pt;"&gt;Next&lt;/SPAN&gt;&lt;/DIV&gt;
&lt;DIV&gt;&lt;SPAN style="color: rgb(35, 111, 161); font-size: 10pt;"&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/DIV&gt;
&lt;DIV&gt;&lt;SPAN style="color: rgb(35, 111, 161); font-size: 10pt;"&gt;Collection_In.Rows.RemoveAt(0)&lt;/SPAN&gt;&lt;/DIV&gt;
&lt;DIV&gt;&lt;SPAN style="color: rgb(35, 111, 161); font-size: 10pt;"&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/DIV&gt;
&lt;DIV&gt;&lt;SPAN style="color: rgb(35, 111, 161); font-size: 10pt;"&gt;For Each row As DataRow In Collection_In.Rows&lt;/SPAN&gt;&lt;/DIV&gt;
&lt;DIV&gt;&lt;SPAN style="color: rgb(35, 111, 161); font-size: 10pt;"&gt;&amp;nbsp; &amp;nbsp; Dim newRow As DataRow = dt.NewRow()&lt;/SPAN&gt;&lt;/DIV&gt;
&lt;DIV&gt;&lt;SPAN style="color: rgb(35, 111, 161); font-size: 10pt;"&gt;&amp;nbsp; &amp;nbsp; For iColumn = 0 to Collection_In.Columns.Count - 1&lt;/SPAN&gt;&lt;/DIV&gt;
&lt;DIV&gt;&lt;SPAN style="color: rgb(35, 111, 161); font-size: 10pt;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; newRow(iColumn) = row(iColumn)&lt;/SPAN&gt;&lt;/DIV&gt;
&lt;DIV&gt;&lt;SPAN style="color: rgb(35, 111, 161); font-size: 10pt;"&gt;&amp;nbsp; &amp;nbsp; Next&lt;/SPAN&gt;&lt;/DIV&gt;
&lt;DIV&gt;&lt;SPAN style="color: rgb(35, 111, 161); font-size: 10pt;"&gt;&amp;nbsp; &amp;nbsp; dt.Rows.Add(newRow)&lt;/SPAN&gt;&lt;/DIV&gt;
&lt;DIV&gt;&lt;SPAN style="color: rgb(35, 111, 161); font-size: 10pt;"&gt;Next&lt;/SPAN&gt;&lt;/DIV&gt;
&lt;DIV&gt;&lt;SPAN style="color: rgb(35, 111, 161); font-size: 10pt;"&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/DIV&gt;
&lt;DIV&gt;&lt;SPAN style="color: rgb(35, 111, 161); font-size: 10pt;"&gt;Collection_Out = dt&lt;/SPAN&gt;&lt;/DIV&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;Results :&lt;/STRONG&gt; &lt;BR /&gt;&lt;STRONG&gt;Collection before these two stages:&lt;/STRONG&gt;&lt;BR /&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="25850.png"&gt;&lt;img src="https://community.blueprism.com/t5/image/serverpage/image-id/25983iACC05ECF48FEB699/image-size/large?v=v2&amp;amp;px=999" role="button" title="25850.png" alt="25850.png" /&gt;&lt;/span&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;STRONG&gt;Collection after these two stages:&lt;BR /&gt;&lt;/STRONG&gt;&lt;BR /&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="25851.png"&gt;&lt;img src="https://community.blueprism.com/t5/image/serverpage/image-id/25982iAFBF240A90B4C67A/image-size/large?v=v2&amp;amp;px=999" role="button" title="25851.png" alt="25851.png" /&gt;&lt;/span&gt;&lt;BR /&gt;&lt;BR /&gt;Let me know if you face any difficulties implementing this.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;&lt;BR /&gt;------------------------------&lt;BR /&gt;Kindly up vote this as "Best Answer" if it adds value or resolves your query in anyway possible, happy to help.&lt;BR /&gt;&lt;BR /&gt;Regards,&lt;BR /&gt;&lt;BR /&gt;Mukesh Kumar - Senior Automation Developer&lt;BR /&gt;&lt;BR /&gt;NHS, England, United Kingdom, GB&lt;BR /&gt;------------------------------&lt;BR /&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 11 May 2023 20:51:00 GMT</pubDate>
      <guid>https://community.blueprism.com/t5/Product-Forum/Collection/m-p/50474#M5703</guid>
      <dc:creator>Mukeshh_k</dc:creator>
      <dc:date>2023-05-11T20:51:00Z</dc:date>
    </item>
    <item>
      <title>RE: Collection</title>
      <link>https://community.blueprism.com/t5/Product-Forum/Collection/m-p/50475#M5704</link>
      <description>&lt;P&gt;Let me know if you face any difficulties with libraries although this would only require basic libraries and those might already be present in your collection manipulation object.&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;BR /&gt;&lt;BR /&gt;------------------------------&lt;BR /&gt;Kindly up vote this as "Best Answer" if it adds value or resolves your query in anyway possible, happy to help.&lt;BR /&gt;&lt;BR /&gt;Regards,&lt;BR /&gt;&lt;BR /&gt;Mukesh Kumar - Senior Automation Developer&lt;BR /&gt;&lt;BR /&gt;NHS, England, United Kingdom, GB&lt;BR /&gt;------------------------------&lt;BR /&gt;</description>
      <pubDate>Thu, 11 May 2023 21:05:00 GMT</pubDate>
      <guid>https://community.blueprism.com/t5/Product-Forum/Collection/m-p/50475#M5704</guid>
      <dc:creator>Mukeshh_k</dc:creator>
      <dc:date>2023-05-11T21:05:00Z</dc:date>
    </item>
  </channel>
</rss>

