<?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: Removing Duplication from a collection but keeping related reference in Product Forum</title>
    <link>https://community.blueprism.com/t5/Product-Forum/Removing-Duplication-from-a-collection-but-keeping-related/m-p/99879#M47322</link>
    <description>Thank you so much &lt;a href="https://community.blueprism.com/t5/user/viewprofilepage/user-id/1843"&gt;@devneetmohanty07&lt;/a&gt; , just tested it, and looks like is doing what I needed, I will try further as I need more example,,, but I like this code, I really appreciate all details provided...​</description>
    <pubDate>Mon, 21 Feb 2022 13:05:48 GMT</pubDate>
    <dc:creator>LorenzoCapocci1</dc:creator>
    <dc:date>2022-02-21T13:05:48Z</dc:date>
    <item>
      <title>Removing Duplication from a collection but keeping related reference</title>
      <link>https://community.blueprism.com/t5/Product-Forum/Removing-Duplication-from-a-collection-but-keeping-related/m-p/99877#M47320</link>
      <description>Hi Team, &lt;BR /&gt;I would like to ask for your help to help remove duplicate details from column B but keeping on referenced to info in column A...&lt;BR /&gt;The result should be the same as from column C &amp;amp; D .&lt;BR /&gt;basically trying to the normal duplicate action removal, it would make me loose reference to column C, but I cannot have that happening.....&lt;BR /&gt;&lt;BR /&gt;Are you able to help me? &lt;BR /&gt;Thank you&lt;BR /&gt;the duplicate work is done from Column B (D) as main check only&lt;BR /&gt;A &amp;amp; B is the original result&lt;BR /&gt;C&amp;amp;D is the desired result &lt;BR /&gt;I hope I was clear on this matter.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;
&lt;TABLE width="662"&gt;
&lt;TBODY&gt;
&lt;TR&gt;
&lt;TD width="125"&gt;A&lt;/TD&gt;
&lt;TD width="174"&gt;B&lt;/TD&gt;
&lt;TD width="64"&gt;VS&lt;/TD&gt;
&lt;TD width="125"&gt;C&lt;/TD&gt;
&lt;TD width="174"&gt;D&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD&gt;BOM Id Standalone&lt;/TD&gt;
&lt;TD&gt;Stocked Item Id Standalone&lt;/TD&gt;
&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;
&lt;TD&gt;BOM Id Standalone&lt;/TD&gt;
&lt;TD&gt;Stocked Item Id Standalone&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD&gt;S3100L&lt;/TD&gt;
&lt;TD&gt;GH88015601&lt;/TD&gt;
&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;
&lt;TD&gt;B00ESF&lt;/TD&gt;
&lt;TD&gt;GH88301103&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD&gt;S3100L&lt;/TD&gt;
&lt;TD&gt;GH88015601&lt;/TD&gt;
&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;
&lt;TD&gt;S3100K&lt;/TD&gt;
&lt;TD&gt;GH88301103&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD&gt;S3100K&lt;/TD&gt;
&lt;TD&gt;GH88301103&lt;/TD&gt;
&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;
&lt;TD&gt;S3100K&lt;/TD&gt;
&lt;TD&gt;GH88301203&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD&gt;S3100K&lt;/TD&gt;
&lt;TD&gt;GH88301103&lt;/TD&gt;
&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;
&lt;TD&gt;S3100L&lt;/TD&gt;
&lt;TD&gt;GH88301203&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD&gt;B00ESF&lt;/TD&gt;
&lt;TD&gt;GH88301103&lt;/TD&gt;
&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;
&lt;TD&gt;S3100L&lt;/TD&gt;
&lt;TD&gt;GH88015601&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD&gt;S3100K&lt;/TD&gt;
&lt;TD&gt;GH88301203&lt;/TD&gt;
&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;
&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;
&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD&gt;S3100L&lt;/TD&gt;
&lt;TD&gt;GH88301203&lt;/TD&gt;
&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;
&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;
&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD&gt;S3100L&lt;/TD&gt;
&lt;TD&gt;GH88301203&lt;/TD&gt;
&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;
&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;
&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD&gt;S3100K&lt;/TD&gt;
&lt;TD&gt;GH88301203&lt;/TD&gt;
&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;
&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;
&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;
&lt;/TR&gt;
&lt;/TBODY&gt;
&lt;/TABLE&gt;</description>
      <pubDate>Fri, 18 Feb 2022 21:20:40 GMT</pubDate>
      <guid>https://community.blueprism.com/t5/Product-Forum/Removing-Duplication-from-a-collection-but-keeping-related/m-p/99877#M47320</guid>
      <dc:creator>LorenzoCapocci1</dc:creator>
      <dc:date>2022-02-18T21:20:40Z</dc:date>
    </item>
    <item>
      <title>Re: Removing Duplication from a collection but keeping related reference</title>
      <link>https://community.blueprism.com/t5/Product-Forum/Removing-Duplication-from-a-collection-but-keeping-related/m-p/99878#M47321</link>
      <description>&lt;SPAN&gt;Hi Lorenzo,&lt;BR /&gt;&lt;BR /&gt;We can use a LINQ object to get the unique records as per your requirement. You can create a new business object and add the below External References ('&lt;STRONG&gt;S&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;STRONG&gt;ystem.Data.DataSetExtensions.dll&lt;/STRONG&gt;&lt;SPAN&gt;', '&lt;/SPAN&gt;&lt;STRONG&gt;System.Core.dll&lt;/STRONG&gt;&lt;SPAN&gt;') and Namespace Imports ('&lt;/SPAN&gt;&lt;STRONG&gt;System.Data.DataSetExtensions&lt;/STRONG&gt;&lt;SPAN&gt;', '&lt;/SPAN&gt;&lt;STRONG&gt;System.LINQ&lt;/STRONG&gt;&lt;SPAN&gt;' and '&lt;STRONG&gt;System.Collections.Generic&lt;/STRONG&gt;') on the Page Description stage of your Initialize action for the LINQ queries to work properly. Also, ensure that the language is selected as '&lt;/SPAN&gt;&lt;STRONG&gt;Visual Basic&lt;/STRONG&gt;&lt;SPAN&gt;':&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="36343.png"&gt;&lt;img src="https://community.blueprism.com/t5/image/serverpage/image-id/36356iA97B542CB645A829/image-size/large?v=v2&amp;amp;px=999" role="button" title="36343.png" alt="36343.png" /&gt;&lt;/span&gt;&lt;BR /&gt;&lt;SPAN&gt;Once you have the updated code options as shown above, create a new action named '&lt;/SPAN&gt;&lt;STRONG&gt;Get Unique Rows&lt;/STRONG&gt;&lt;SPAN&gt;' and pass two input arguments, &lt;EM&gt;&lt;STRONG&gt;Input Collection&lt;/STRONG&gt;&lt;/EM&gt; (Collection) and &lt;EM&gt;&lt;STRONG&gt;Field Names&lt;/STRONG&gt;&lt;/EM&gt; (Collection). Based on the field names that you provide the unique records will be fetched from the Input Collection. Also, set an Output parameter as &lt;EM&gt;&lt;STRONG&gt;Output Collection&lt;/STRONG&gt;&lt;/EM&gt; (Collection) for this action as shown below:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="36344.png"&gt;&lt;img src="https://community.blueprism.com/t5/image/serverpage/image-id/36357iD4B437D233422215/image-size/large?v=v2&amp;amp;px=999" role="button" title="36344.png" alt="36344.png" /&gt;&lt;/span&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Add the code stage and use the below code with the input and out arguments as show:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;CODE&gt;Dim listOfFields = New List(Of String)()&lt;BR /&gt;listOfFields = Field_Names.AsEnumerable().Select(Function(dr) dr.Field(Of String)("Fields")).ToList()&lt;BR /&gt;Output_Collection = Input_Collection.DefaultView.ToTable(True,listOfFields.ToArray())&lt;BR /&gt;&lt;BR /&gt;&lt;/CODE&gt;&lt;BR /&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="36345.png"&gt;&lt;img src="https://community.blueprism.com/t5/image/serverpage/image-id/36355iD7706E3805EFDA8F/image-size/large?v=v2&amp;amp;px=999" role="button" title="36345.png" alt="36345.png" /&gt;&lt;/span&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="36346.png"&gt;&lt;img src="https://community.blueprism.com/t5/image/serverpage/image-id/36353iA594D1FB17C7F02D/image-size/large?v=v2&amp;amp;px=999" role="button" title="36346.png" alt="36346.png" /&gt;&lt;/span&gt;&lt;BR /&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="36347.png"&gt;&lt;img src="https://community.blueprism.com/t5/image/serverpage/image-id/36362i244B925FC941100C/image-size/large?v=v2&amp;amp;px=999" role="button" title="36347.png" alt="36347.png" /&gt;&lt;/span&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;The run results are as follows:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN style="text-decoration: underline"&gt;&lt;STRONG&gt;Input Arguments:&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="36348.png"&gt;&lt;img src="https://community.blueprism.com/t5/image/serverpage/image-id/36363i8E6D8720CBF634C6/image-size/large?v=v2&amp;amp;px=999" role="button" title="36348.png" alt="36348.png" /&gt;&lt;/span&gt;&lt;BR /&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="36349.png"&gt;&lt;img src="https://community.blueprism.com/t5/image/serverpage/image-id/36360iCE6BB3EB173AF19E/image-size/large?v=v2&amp;amp;px=999" role="button" title="36349.png" alt="36349.png" /&gt;&lt;/span&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN style="text-decoration: underline"&gt;&lt;STRONG&gt;Output Result:&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="36350.png"&gt;&lt;img src="https://community.blueprism.com/t5/image/serverpage/image-id/36364i2B14D74A2EF1C904/image-size/large?v=v2&amp;amp;px=999" role="button" title="36350.png" alt="36350.png" /&gt;&lt;/span&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN style="color: #ff0000"&gt;&lt;SPAN style="text-decoration: underline"&gt;&lt;STRONG&gt;NOTE: &lt;/STRONG&gt;&lt;/SPAN&gt;For your use case you need to use both the fields 'A' and 'B' in the 'Field Names' collection then only it will take it in a group&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;You can publish the action and test the same from Process Studio. Let us know if this helps you out and please mark the answer as the '&lt;STRONG&gt;&lt;EM&gt;Best Answer&lt;/EM&gt;&lt;/STRONG&gt;' if it resolves your query so that others can track the answer easily &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/SPAN&gt;</description>
      <pubDate>Sat, 19 Feb 2022 00:33:22 GMT</pubDate>
      <guid>https://community.blueprism.com/t5/Product-Forum/Removing-Duplication-from-a-collection-but-keeping-related/m-p/99878#M47321</guid>
      <dc:creator>devneetmohanty07</dc:creator>
      <dc:date>2022-02-19T00:33:22Z</dc:date>
    </item>
    <item>
      <title>Re: Removing Duplication from a collection but keeping related reference</title>
      <link>https://community.blueprism.com/t5/Product-Forum/Removing-Duplication-from-a-collection-but-keeping-related/m-p/99879#M47322</link>
      <description>Thank you so much &lt;a href="https://community.blueprism.com/t5/user/viewprofilepage/user-id/1843"&gt;@devneetmohanty07&lt;/a&gt; , just tested it, and looks like is doing what I needed, I will try further as I need more example,,, but I like this code, I really appreciate all details provided...​</description>
      <pubDate>Mon, 21 Feb 2022 13:05:48 GMT</pubDate>
      <guid>https://community.blueprism.com/t5/Product-Forum/Removing-Duplication-from-a-collection-but-keeping-related/m-p/99879#M47322</guid>
      <dc:creator>LorenzoCapocci1</dc:creator>
      <dc:date>2022-02-21T13:05:48Z</dc:date>
    </item>
    <item>
      <title>Re: Removing Duplication from a collection but keeping related reference</title>
      <link>https://community.blueprism.com/t5/Product-Forum/Removing-Duplication-from-a-collection-but-keeping-related/m-p/99880#M47323</link>
      <description>Glad your query got resolved and my solution could help you out Lorenzo:)</description>
      <pubDate>Mon, 21 Feb 2022 14:55:00 GMT</pubDate>
      <guid>https://community.blueprism.com/t5/Product-Forum/Removing-Duplication-from-a-collection-but-keeping-related/m-p/99880#M47323</guid>
      <dc:creator>devneetmohanty07</dc:creator>
      <dc:date>2022-02-21T14:55:00Z</dc:date>
    </item>
  </channel>
</rss>

