For each row data

I have data in data sheet. I’m using for each row to loop through the data. When there is a duplicate I need the bot to recognize and input the data in a field with a space and a letter to distinguish the 2 or 3. How do I get it to recognize and perform this action? thanks in advance

HI @brettthompson,

They way I often do this is by having the robot keep a list of the values it has come across before. As it iterates through the data it is adding the value into the list so it ‘remembers’ having seen the value before. Then you can use that list to decide whether to perform additional actions like changing the value.

Let me know if that seems like it will help, can probably mock up an example for you.

Many thanks,

in general we can do this by grouping the data and then process the group members of the different groups. When processing the group, we can realize the counter of the member which it had within its group

can you share some sample data or giving more info how many cols are involved for the duplicate check. Thanks

Hi @brettthompson,

Refer below link



I need the bot to recognize that this is a duplicate on the loop around and when it inputs the data it should look like this

8100 c
8100 c
8100 c
adds an extra space to distinguish

will it didn’t add the extra spaces. But the first should have one space the 2nd has 2 spaces and the third has 3

Hi @brettthompson ,

You can follow something similar to below logic.

1. Start
2. Initialize a ItemList of type List<string>/DataTable
3. for each row in InputTable:
	ItemNotFound = True;
	while ItemNotFound:
		if(row(item).ToString() present in ItemList):
		if(row(item).ToString() not present in ItemList):
			Add row(item).ToString()+"_"+index to ItemList
4. Print ItemList
5. Stop

We need to implement other solution if execution timing is main concern as this method has nested loops.