I am retrieving all Queue items via a For Each and this is working great.
Now i am trying to write the queue items into Excel.
It works, but just for the first retrieved item. It keeps looping through this same item.
If i don’t stop the loop, it might continue for hours.
I use the Excel application scope, with the Read Range activity followed by for each, with For Each: Row - value output of the read range.
I combine a few ‘IF’ activities to check for values, if there is no match it will continue with ‘Insert/Delete Rows’ activity.
Am i doing something wrong with the For Each that it loops?
Is it because it is trying to loop through all the available data in Excel? it’s about 7000.
If you read the queue items you have them in a datatable. Just use Workbook Write Wrange and write that datatable to the Excel file.
If you need to remove or edit some of the data before writing to Excel, do that in your DT.
But I’m curious why you are using queue items in this way. It’s not really how queues are intended to be used. Generally you process queue items one by one, getting them with Get Transaction so that the status is updated to In Progress then either success or fail.
The Queue items are filled with values that have been read off a web page.
One queue contains a few different values, that are supposed to be filled inside one row, in specific columns.
I retrieve the queue items, add them with different write to cell activities to excel in specific places through variables.
The for each activity does the first contained queue perfectly. But it keeps repeating that same one, it will not move to the next queue item.
It won’t move to the next queue item because you aren’t using queues properly. You need to Get Transaction to get an item to process, process it, then set its status to Success or Fail. Then loop back around and Get Transaction again, and it won’t get the first one again because it’s marked complete.
I used the Get Queue Items activity. But i understand i should be using the Get Transaction Item.
After implementing this activity, i can’t get the For Each to loop through it.