cancel
Showing results for 
Search instead for 
Did you mean: 

How to get Unique value from a column without looping

KumariYadav1
Level 5
Hi, i am little new to blue prism ,Please help me out with a situation
i will explain the situation .......
i have an excel file and in this i need to find the unique customer name and after getting that customer name i need the whole row for that particular customer name 
because i need the details of that customer to perform other operation. i want that row to get into collection nd then perform other needed operation
But i don't want to use loop for getting unique customer name as its taking so much of tym ,actually i have around 200 to 300 data in excel so iterating each row is time taking. I have tried looping 20 rows nd perform all opearation , for this it took around 13 min.
Please guide me as soon as possible.

------------------------------
Kumari Yadav
------------------------------
1 BEST ANSWER

Best Answers

Have you changed the code to options to C# in initialize page? Also make sure the Column name you are passing is correct. But fto make it easy I have attached VBO here. Just import and use it.

------------------------------
Amlan Sahoo
RPA Consultant
Equinix
------------------------------
Regards,
Amlan Sahoo

View answer in original post

16 REPLIES 16

EmersonF
MVP

You can play this excel for a collection depending on the number of lines in this excel, and then you can use VBO Collection manipulation following this step by step here:

HOW TO USE FILTER ON A COLLECTION STAGE | Blue Prism Product



------------------------------
Emerson Ferreira
Sr Business Analyst
Avanade Brasil
+55 (081) 98886-9544
If my answer helped you? Mark as useful!
------------------------------
Sr Cons at Avanade Brazil

H Kumari,

PFB Code it's very easy to use, It is C# code.

DataView view = new DataView(InputColl);
DataTable distinctValues = view.ToTable(true,(Input));
Output = distinctValues;

20845.png

20846.png

------------------------------
Amlan Sahoo
RPA Consultant
Equinix
------------------------------
Regards,
Amlan Sahoo

Thanks Amlan i will try this code and will come back to you if any issue occurred.
Can you tell me after getting this filtered value that is unique value from the column how to get the corresponding row for this unique value.
suppose in "customer name" column we applied filter and we get the unique customer name .but for this customer name we have other details also maintained in a row (for eg customer address , phone and many thing) so we want to fetch this whole row in a collection to perform other operation.
guide me on this.

------------------------------
Kumari Yadav
------------------------------

Yes Kumari you can filter. Also if the whole row is Unique for a customer then you can modify the same code and include all the column names there so that you can all the details in one go.

It's upto your requirement.

------------------------------
Amlan Sahoo
RPA Consultant
Equinix
------------------------------
Regards,
Amlan Sahoo

Thanks for your response amlan .But actually i don't have idea about the c# coding But still i will just try filtering this unique customer name and after that if some logic i can apply i will check on that .

But if you can provide me the code for same like for each unique customer name if we can get the corresponding rows also copied in the collection it will be really a great help.
thanks in advance.

------------------------------
Kumari Yadav
------------------------------

DataView view = new DataView(InputColl);
DataTable distinctValues = view.ToTable(true,"Field1","Field2","Field3");

Output = distinctValues;


You cand keep on adding column Name that's not an issue

------------------------------
Amlan Sahoo
RPA Consultant
Equinix
------------------------------
Regards,
Amlan Sahoo

Hey Amlan first of all thanku for your help.
But  if you can modify this code as per the VBO code i mean while adding in Blueprism code stage i know some more things will also get added  but i am not sure how to do that.
"DataView view = new DataView(InputColl);
DataTable distinctValues = view.ToTable(true,(Input));
Output = distinctValues;"
can you plz do it
Thanks

------------------------------
Kumari Yadav
------------------------------

HI Kumari,

The above code is for single input. So if you want multiple inputs then you have to add multiple inputs to your code stage start parameter and  use it in code stage. Also in intialie page of object change the code options to C# by default it will be Visual Basics

DataView view = new DataView(InputColl);
DataTable distinctValues = view.ToTable(true,(Input),(inpu1),(input2));
Output = distinctValues;

------------------------------
Amlan Sahoo
RPA Consultant
Equinix
------------------------------
Regards,
Amlan Sahoo

Hi Amlan,
i tried this but one issue i am getting ,actually i am not getting output row ,what you have showed in  second screenshot.
so because of this i am not getting any output collection.
guide me on this!

------------------------------
Kumari Yadav
------------------------------