I am retrieving information from a webpage. The information could be duplicate, depending on how many times the customer send in the document. For the activity Add Data Row, i have made it so, that the value is only added once. So the Excel file will contain unique values.
But my activity ‘Add Queue Item’ keeps on adding items. So my Excel file will contain 10 rows with values and my Queue is filled with 40 items.
Is there a possibility to add Queue item, only when my Try Catch; Add Data Row has succeeded?
That’s what you want. It has nothing to do with adding the Add Queue Item under Add Data Row. It’s because you have a unique column and are trying to add a non-unique value to it, so it fails. That’s the point. It fails and jumps to the catch block. What are you doing in the catch block? You have to add activities to control what happens when the Exception block is processed.
Assign as True to the same variable in the catch block. This means we can identify that if there is no exception at data row the variable value will be false, else True
Now, take if condtition as Var = False, if it is false then only add data to the queue else not. After that just reset the variable to True
This is a lot of extra work for nothing. Just put the Add Queue Item inside the Try, after the Add Data Row, and if Add Data Row fails it’ll skip Add Queue Item and move to the Catch block.