Set status for Queue item in for each

Hey guys,
so i’m using “get queue item” to get items from queue “A”, that contains several variables. Then i use a for each to copy the variables in the queue item to queue “B” using “add queue item”.
I’m not using a full framework with transactioninfo, just init, Process and End.

Now, i want to set a “Success” status on the item in queue “A” that has been copied to queue “B”. I’m thinking i could use “set transaction status” somehow, but cant seem to figure out how to use it correctly as i’m just working with a for each solution for the items in queue “A”.

So to repeat:
Using get queue items in a for each item reading from queue “A”.
Copy the info from the item using "add queue item to queue "B.
When the item has been added to queue “B” i want to change the status of that item in queue “A” to success.

is there a way?

Hey @thomasb82
You could surround your copying process by try catch . If any exception is caught then set transaction status failed and continue with the loop while if everything goes fine then set status to success

can try that, but how would i use the set status activity for an item in another queue?

According to your query after copying process the item in queue A should be set to success. Correct?

Yeah, see the printscreen. “Konsultdel1kö” is a datatable created from queue “A”.
Each row becomes a queue item using the “Add queue item” activity.
So, when the current row has been added as an queue item in queue “B”, the robot need to change the status of the queue item with the corresponding referenceId in queue “A” to success.

So it’s basically: go into queue “A” and look for item with referenceid xxx, set the status to success.

I’m working in a for each now using the datatable copy of queue “A”. Should i be working directly on the IEnumerable variable created by the get queue items activity for queue A?

Why creating the data table with queue A items. Just directly bring queue A in for each

yeah just realized that as well :slight_smile:

1 Like

Just iterate your queue A and copy in queue B if any exception occurs then status failed otherwise success.

thanks, will try that.