Add Queue item based on if Add Data Row activity has written data


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?



1 Like

Put Add Queue Item right after Add Data Row, inside the Try. Then if Add Data Row faults, it will jump to the catch block, skipping Add Queue Item.

1 Like

Hey @sirwa

You need to just place Add Queue Item below the Add Data Row activity which will do the job.


1 Like

Thanks for the quick reply!

Unfortunately i get the following error on the Add Data Row whenever i place the Add Queue Item underneath the Add Data Row

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.

@sirwa Try below steps. Below workflow for ref (2.4 KB)

  • Take a variable of boolean type and assign the value as False after Add Data Row

  • 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

1 Like

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.

1 Like

Thanks i tried both, the last one was indeed a bit easier. Thanks again for the help!

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.