I wanted some help where i am stuck. The problem is in a column i wanted to highlight all the duplicate values example suppose if there is a column A and it has no. of values i want to highlight those values which appear more than once. I have attached an image for the example
Here for ex. 5406830896 has appeared more than once so it should be highlighted.
Group the value of PO to check the duplicates
2.Use If Condition to check the value that we get in the scenario 1
3.Create a counter while in the loop this counter will be the determinator to set in the Set Range color.
You can try the below logic for your problem statement.
Read the entire excel data using read range activity and store into dtTable.
Use assign activity and try to get all unique values from the column “PO” using this command: dtTemp = dtTable.DefaultView.ToTable(true,“PO”)
The return type will be datatable.
This way you will get all unique rows of data with reference to “PO” column.
Use For each row activity and iterate through dtTemp. Use assign activity inside that for each row, arrRows=( from dr as datarow in dtTable where dr(“PO”).ToString = row(“PO”).ToString select dr).ToArray )
The return type will be array of data rows.
Check the count of each iteration and if count is greater than 1, you can store or highlighted those values.
That one is Linq query. It’s used to retrieve the data from the dataset. You can go through the below website to get the basic understanding and then start implementing in UiPath.
It would be a great help if you could share a xaml related to the topic as my code is not working today. iterating over increased counter is giving all the values and the arrRows variable is containing all the values of the column PO not only the condition based values.
Hi @singhonkar,
i have attached the Xaml ,
Also i would like to add when iterating, for testing purpose, over arrRows variable using a for each loop with type argument as datarow array type and displaying the item by item(0).toString the values obtained are not as mentioned in the condition of arrRows their are all values coming which belong to dttemp. Please help.
You were using count variable logic to count the no. of occurences separately and i’ve used Count property of array to count the no. of PO values in array. No need to perform separate logic.
Please mark it as solution as it may help others. Cheers!!