11-08-20 06:32 PM
11-08-20 09:32 PM
12-08-20 09:10 AM
21-03-21 05:00 AM
03-09-21 02:57 PM
31-12-21 06:32 AM
31-12-21 07:56 AM
Hi Lakshmi,
In order to work with huge collections while performing an operation where you require the common rows the best approach would be to develop a simple code stage using LINQ's. You can create a custom business object called 'Utility - Collection (LINQ)'.
- In the 'Initialise' action, go to the Page Description stage and add the following External References under 'Code Options' tab: System.Core.dll
and System.Data.DataSetExtensions.dll
along with the Namespace Imports as System.Data.DataSetExtensions
and System.LINQ
. Also, choose the Language as Visual Basic
- Now, create a custom action called 'Get Common Rows' with two input parameters called: Input Collection One and Input Collection Two and map the same to two collection stages with the same name. Also, create an output parameter called Output Collection and map the same to another collection stage.
- Next, drag a code stage with input arguments as 'Input Collection One' and 'Input Collection Two' and output argument as 'Output Collection' and map all the respective collection stages as shown below.
- Add the following code under the 'Code' tab of the code stage:Output_Collection = Input_Collection_One.AsEnumerable().Intersect(Input_Collection_Two.AsEnumerable(),DataRowComparer.Default).CopyToDataTable()
- Publish the action, save and close the business object and then use the same from Process Studio for your testing.
Test Results:
Test Scenario:-
In our case, we have two collections with 4 rows in total each out of which 3 rows are common in both.
Inputs for the Action:-
Outputs for the action:-
Let us know if it helps to resolve your query.