Blue Prism Product

 View Only
last person joined: 13 hours ago 

This community covers the core Blue Prism product.

  • 1.  Get Unique Values from more than one column in a collection

    Posted 4 days ago
    Hi

    I have a scenario where I have to get unique values from more than one column in a collection. Right now I am achieving this using loops which is taking more execution time due to high number of records. I am looking for a using code stage to achieve similar thing or any other method with less execution time.

    Example:
    Input Collection

    ID          Name    Email                                 Mobile

    1            A            A@GMAIL.COM               91****

    2            B            B@GMAIL.COM               91****

    3            C            C@GMAIL.COM               91****

    4            A            A@GMAIL.COM               91****

    5            B            B@GMAIL.COM               91****

    6            D            D@GMAIL.COM              91****


    Expected Output Collection:

    Name    Email                  

    A            A@GMAIL.COM

    B            B@GMAIL.COM

    C            C@GMAIL.COM

    D            D@GMAIL.COM

        

    Edit:
    Input collection can also has some Null Values in Email Column



    ------------------------------
    vinod chinthakindi
    ------------------------------


  • 2.  RE: Get Unique Values from more than one column in a collection

    Posted 4 days ago
    Hey @vinod chinthakindi,

    You can try the below code for removing duplicates - but ​always keep in mind, that whether it is C# code or any other programming language, it will always perform the loop function (for each). you can set the values accordingly as per your table name.

    public DataTable RemoveDuplicateRows(DataTable dTable, string colName)
    {
       Hashtable hTable = new Hashtable();
       ArrayList duplicateList = new ArrayList();
    
       //Add list of all the unique item value to hashtable, which stores combination of key, value pair.
       //And add duplicate item value in arraylist.
       foreach (DataRow drow in dTable.Rows)
       {
          if (hTable.Contains(drow[colName]))
             duplicateList.Add(drow);
          else
             hTable.Add(drow[colName], string.Empty); 
       }
    
       //Removing a list of duplicate items from datatable.
       foreach (DataRow dRow in duplicateList)
          dTable.Rows.Remove(dRow);
    
       //Datatable which contains unique records will be return as output.
          return dTable;
    }

    Thanks & Regards

    ------------------------------
    Rushabh Dedhia
    Founder,
    Biznessology (https://www.linkedin.com/company/biznessology/)
    +91 9428860307
    ------------------------------



  • 3.  RE: Get Unique Values from more than one column in a collection

    Posted 4 days ago
    Hi Vinod,

    You can extend the 'Collection Manipulation' business object and add the Namespace Imports: 'System.Collections.Generic' on the Page Description stage of your Initialize action for the LINQ queries to work properly. Also, ensure that the language is selected as 'Visual Basic'.


    Once you have the updated code options as shown above, create a new action named 'Get Unique Values' and pass two input arguments, 'Input Collection' (Collection) and 'Field Names' (Collection) having a single column called 'Fields' of text data type. Based on the field name in each row of the Field Names collection unique rows will be fetched from the Input Collection. Also set an Output parameter as 'Output Collection' (Collection) for this action as shown below:



    Add the code stage and use the below code with the input and out arguments as show:

    Dim listOfFields = New List(Of String)()
    
    For Each row In Field_Names.Rows
    
    	listOfFields.Add(row("Fields").ToString())
    
    Next
    
    Output_Collection = Input_Collection.DefaultView.ToTable(True,listOfFields.ToArray())





    The run results are as follows:

    Input Arguments:





    Output Result:



    You can publish the action and test the same from Process Studio. Let us know if this helps you out :)

    ------------------------------
    ----------------------------------
    Hope it helps you out and if my solution resolves your query, then please mark it as the 'Best Answer' so that the others members in the community having similar problem statement can track the answer easily in future

    Regards,
    Devneet Mohanty
    Intelligent Process Automation Consultant | Sr. Consultant - Automation Developer,
    WonderBotz India Pvt. Ltd.
    Blue Prism Community MVP | Blue Prism 7x Certified Professional
    Website: https://devneet.github.io/
    Email: devneetmohanty07@gmail.com

    ----------------------------------
    ------------------------------



  • 4.  RE: Get Unique Values from more than one column in a collection

    Posted 3 days ago
    Hi @Devneet Mohanty

    I tried your code but got an error saying "row is not declared".​

    add the Namespace Imports: 'System.Collections.Generic' and added System.Linq.dll .with the language is selected as 'Visual Basic'.
    Am I missing any specific dll for the above code?​

    ------------------------------
    vinod chinthakindi
    ------------------------------



  • 5.  RE: Get Unique Values from more than one column in a collection

    Posted 3 days ago
    Hi Vinod,

    You dont even require the LINQ dll for this. This only needs the namespace import 'System.Collections.Generic' to be added separately along with the default namespace imports that get generated automatically whenever you create any new business object. You can see the below screenshot for reference:



    The error you are getting might be due to the fact that you are not declaring the data type of the row variable in the for each statement. I do not need to do that sine I guess I am on Blue Prism v.6.10.4 which uses an updated .NET runtime environment.

    You can try this updated code and check if it works:


    Dim listOfFields = New List(Of String)()
     
    For Each row As System.Data.DataRow In Field_Names.Rows
     
    listOfFields.Add(row("Fields").ToString())
     
    Next
     
    Output_Collection = Input_Collection.DefaultView.ToTable(True,listOfFields.ToArray())


    Here, I have just added the highlighted section of the code to declare the variable row as a DataRow() class type object.

    ------------------------------
    ----------------------------------
    Hope it helps you out and if my solution resolves your query, then please mark it as the 'Best Answer' so that the others members in the community having similar problem statement can track the answer easily in future

    Regards,
    Devneet Mohanty
    Intelligent Process Automation Consultant | Sr. Consultant - Automation Developer,
    WonderBotz India Pvt. Ltd.
    Blue Prism Community MVP | Blue Prism 7x Certified Professional
    Website: https://devneet.github.io/
    Email: devneetmohanty07@gmail.com

    ----------------------------------
    ------------------------------



  • 6.  RE: Get Unique Values from more than one column in a collection

    Posted 3 days ago
    Hi @Devneet Mohanty
    I am using BP6.4.2, Above changes in code has resolved the compile error. But while execution it throws a following error. Any idea!



    ------------------------------
    vinod chinthakindi
    ------------------------------



Welcome to the Blue Prism Product Community!

Whether you’re looking to manage a complex infrastructure, maintain security and compliance, bring new products to market faster, or gain operational speed and agility in an uncertain economy, Blue Prism delivers — with the flexibility you need to create the business you want. From deployment on-premise, through a cloud service provider or as SaaS, to a skillful and adaptable digital workforce that continually expands to meet your enterprise needs, you can gain enhanced operational insight and control while your people reclaim the time they need to focus on great work.

Product PageKnowledge BaseBlue Prism Training Offering

FAQs

Blue Prism is intelligent automation — business-developed, no-code automation that pushes the boundaries of robotic process automation (RPA) to deliver value across any business process in a connected enterprise.

A combination of RPA with expanded cognitive and AI capabilities, Blue Prism is different than other automation technology on the market. With one Blue Prism license, you gain instant access to an already AI equipped digital workforce, along with the tools you need to build and delegate automations. Click here for more information on Blue Prism and Intelligent Automation.
To learn more about how Blue Prism can help your organization and how much it will cost to get started, please Contact our Sales department.
Blue Prism can be downloaded from our customer portal. If you would like to consume or download any material it is necessary to create an account on the Portal. Once you have registered, you can access the download options for Blue Prism here.
Yes! Installed on your own machine and supported by our training materials and product documentation, you can use all the features of the full enterprise product for free with our Blue Prism Trial – giving you the opportunity to learn the basics before moving to a full production implementation. Click here for more information and to download the trial.
Yes! You can access our known issue list for Blue Prism from our Support Portal.
Regardless of your industry, Blue Prism’s Digital Workforce can adhere to strict governance and compliance standards without limiting productivity. Click here for more information on how your industry can benefit from Blue Prism.