<?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 Comparing Collections with different number of columns in Product Forum</title>
    <link>https://community.blueprism.com/t5/Product-Forum/Comparing-Collections-with-different-number-of-columns/m-p/48601#M4111</link>
    <description>&lt;P&gt;Hi,&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;I have two collections, coll A and Coll B, CollB has all the columns of coll A and an additional column "Result", Now the problem is I have to compare the collections and find out the unique values from them and write thrm in another collection.&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, 25 May 2023 04:10:00 GMT</pubDate>
    <dc:creator>aanchalm</dc:creator>
    <dc:date>2023-05-25T04:10:00Z</dc:date>
    <item>
      <title>Comparing Collections with different number of columns</title>
      <link>https://community.blueprism.com/t5/Product-Forum/Comparing-Collections-with-different-number-of-columns/m-p/48601#M4111</link>
      <description>&lt;P&gt;Hi,&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;I have two collections, coll A and Coll B, CollB has all the columns of coll A and an additional column "Result", Now the problem is I have to compare the collections and find out the unique values from them and write thrm in another collection.&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, 25 May 2023 04:10:00 GMT</pubDate>
      <guid>https://community.blueprism.com/t5/Product-Forum/Comparing-Collections-with-different-number-of-columns/m-p/48601#M4111</guid>
      <dc:creator>aanchalm</dc:creator>
      <dc:date>2023-05-25T04:10:00Z</dc:date>
    </item>
    <item>
      <title>RE: Comparing Collections with different number of columns</title>
      <link>https://community.blueprism.com/t5/Product-Forum/Comparing-Collections-with-different-number-of-columns/m-p/48602#M4112</link>
      <description>&lt;P&gt;HI As,&lt;BR /&gt;&amp;nbsp;I assume you dont want the other additional&amp;nbsp; column present in the collection B?&lt;BR /&gt;Multiple ways you can get the values&lt;BR /&gt;1) Merge both the collection ( If you have the same columns) and get unique values&amp;nbsp;&lt;BR /&gt;2) Loop the collection A and check the collectionB&amp;nbsp; contain value if it is&amp;nbsp; True then add the row in the new collection&lt;BR /&gt;3.) Check this thread for Inner Join: &lt;BR /&gt;&lt;A href="https://community.blueprism.com/viewdocument/re-comparing-collections?CommunityKey=3743dbaa-6766-4a4d-b7ed-9a98b6b1dd01&amp;amp;tab=librarydocuments?utm_source=blueprism&amp;amp;utm_medium=pweb&amp;amp;utm_campaign=gl-web-2022-q1-12-3-community-related-discussions" target="test_blank"&gt;https://community.blueprism.com/viewdocument/re-comparing-collections?CommunityKey=3743dbaa-6766-4a4d-b7ed-9a98b6b1dd01&amp;amp;tab=librarydocuments?utm_source=blueprism&amp;amp;utm_medium=pweb&amp;amp;utm_campaign=gl-web-2022-q1-12-3-community-related-discussions&lt;/A&gt;&lt;BR /&gt;4) Write Code stage ( C# or vb.net):&lt;BR /&gt;VB.Net:&lt;BR /&gt;INput parameters: &lt;SPAN&gt;I_Collection_B&lt;/SPAN&gt;,&amp;nbsp;&lt;SPAN&gt;I_Collection_B&lt;BR /&gt;Output&amp;nbsp; parameters: O_Collection&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;O_Collection = I_Collection_A.AsEnumerable().Intersect(I_Collection_B.AsEnumerable(),DataRowComparer.Default).CopyToDataTable()&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;In the initailize action&amp;nbsp; under code option make sure the external references and Name spaces are present:&lt;BR /&gt;External reference:&lt;BR /&gt;System.Core.dll&lt;BR /&gt;System.Data.DataSetExtensions.dll&amp;nbsp;&lt;BR /&gt;&lt;STRONG&gt;NameSpaces:&lt;/STRONG&gt;&lt;BR /&gt;System.Data.DataSetExtensions&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Check some other useful articles&amp;nbsp;&lt;BR /&gt;&lt;A href="https://learn.microsoft.com/en-us/dotnet/framework/data/adonet/comparing-datarows-linq-to-dataset" target="test_blank"&gt;https://learn.microsoft.com/en-us/dotnet/framework/data/adonet/comparing-datarows-linq-to-dataset&lt;/A&gt;&lt;BR /&gt;&lt;A href="https://social.msdn.microsoft.com/Forums/en-US/cb8ef7f7-5e7f-4448-9181-4111942b1a7c/how-to-compare-two-data-tables-and-create-a-new-data-table-based-on-the-compared-results-c?forum=aspwebformsdata" target="test_blank"&gt;https://social.msdn.microsoft.com/Forums/en-US/cb8ef7f7-5e7f-4448-9181-4111942b1a7c/how-to-compare-two-data-tables-and-create-a-new-data-table-based-on-the-compared-results-c?forum=aspwebformsdata&lt;/A&gt;&lt;BR /&gt;&lt;A href="https://stackoverflow.com/questions/11862113/how-to-compare-2-datatable-and-get-unique-records-in-3rd-datatable" target="test_blank"&gt;https://stackoverflow.com/questions/11862113/how-to-compare-2-datatable-and-get-unique-records-in-3rd-datatable&lt;/A&gt;&lt;BR /&gt;System.LINQ&lt;CODE&gt;&lt;/CODE&gt;&lt;CODE&gt;&lt;/CODE&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, 25 May 2023 16:13:00 GMT</pubDate>
      <guid>https://community.blueprism.com/t5/Product-Forum/Comparing-Collections-with-different-number-of-columns/m-p/48602#M4112</guid>
      <dc:creator>harish.mogulluri</dc:creator>
      <dc:date>2023-05-25T16:13:00Z</dc:date>
    </item>
  </channel>
</rss>

