Only grabbing the values once from a dictionary list

Hi all. So I’m working on automation where the bot checks items on a web page only once if that item is repeating. I’m using a dictionary list in order to pair the key and the values, I then use the values as variables on an anchor & click activity. The spreadsheet looks like this below:


Now for the first “Delivery Order”, I only want to click “0001” once even though it is repeating four times. If they are all unique, then I want to click on all of them.

I’ve been able to do this with an “if statement” where the condition is “if current value doesn’t equal to previous value, then record the value”; however, it runs into problems once I hit the second Delivery Order who’s first CLIN is the same the previous Delivery Order’s last CLIN.

I’ve also thought about an If condition saying “If this is the first of the list then make sure to click that item, if not then check if we’ve previously recorded it or not”

Workflow looks like this. Thank you!

1 Like

Hi Ben,

I don’t know exactly why you use the dictionary (maybe you use it later). If I understand your process correctly you just want to loop through that table and act on every distinct pair of Delivery Order and CLIN. The table seems to be sorted by Delivery Order so why no just put a simple if with the condition:
rowIndex=0 orelse row(“Delivery Order”).tostring+row(“CLIN”).tostring<>Datatable(rowIndex-1)(“Delivery Order”).tostring+DataTable(rowIndex-1)(“CLIN”).tostring

(you can get rowIndex as an output of the For Each Row). It’s not the most elegant solution but I don’t see why it shouldn’t work

1 Like