Get queue items -set transaction progress!

Hello all,

Im doing get queue items then loop in them but cant do set transaction progress on current item.

And if i want to do get transaction item i can but only one item how to loop them?
Or how to update the statutes after get queue item !

if there is small template will be great,

Thanks

is ensured, that only queue items within the status in Progress are updated with a new Progress?

Hi @Hazem_Saleh

Please take a look at the following approach:

  1. Use the Get Queue Items activity to retrieve multiple queue items. You can store these items in a collection variable, such as a List of QueueItem type, to loop through them.

  2. Use a For Each activity to loop through the queueItems collection.
    Set the Type Argument of the For Each activity to UiPath.Core.QueueItem.

  3. To update the transaction status, you can use the Set Transaction Status activity inside the loop. Here’s how you can do it:

  • Add a Set Transaction Status activity inside the For Each loop.
  • For the TransactionItem property, use the current item from the loop.

Here, item represents the current item in the loop.
→ Set the TransactionStatus property to the desired status, such as Success or Failed.
→ You can also provide additional information, such as a transaction-specific message or data.

  1. After updating the transaction status, continue looping through the remaining queue items.

This sample snippet might help you with the visualization:

Assign: queueItems = Queue.GetQueueItems("YourQueueName", 100)

For Each item In queueItems
    Set Transaction Status:
        TransactionItem = item
        TransactionStatus = "Success"
        TransactionSpecificData = "Additional information if needed"
End For Each

Hope this helps,
Best Regards.

Hi

You can use a FLOWCHART type of workflow instead of a SEQUENCE

Once after opening studio click on NEW in Design tab and choose flowchart

There u can have something like this
image

Cheers @Hazem_Saleh

Thanks,
But i want to use set progress first where i start in the loop! transaction status only successful of failed

something like this,

BR/Hazem

Thanks can i add it to current project based on sequences ?

1 Like

yeah you can still add a FLOWCHART inside your sequence
search as FLOWCHART in activity panel then and drag and drop it inside the sequence you have
@Hazem_Saleh

keep in mind that we use Set Transaction Progress only on Queue Items which do have the status “in Progress”

Thats why we mentioned:

hope your doubts are clarified @Hazem_Saleh

Hello Again,
Im a bit confused here. you are totally right but my challenge is when i get list of queue item and start to process one i cant update the progress! i need to get transactional item first then i can set item progress!

im sure its my confusing here make it worse :stuck_out_tongue:

You have any tiny example!

Thanks

get Queue items ← s at the end will return a collection of queue items but will not change its status

the activities:

  • get transaction item
  • add transaction item

are the ones which will change the status from X to In Progress

is more clear so far?

I want to set the current item from the get Queue item collection to in progress
and of course set transaction status to complete after its been process,

If i havdo while (Condition )

  1. get transaction item.
    2… process
  2. set status
    its work perfectly
    but my challenge im getting all item at once (im unsure if its good practice or not)

This isn’t how you’re supposed to work with queue items. You don’t use Get Queue Items to get a bunch of them and work on them. You use Get Transaction to get one queue item, and work on it. Finish it, then get the next one.

1 Like

as far we have understand we would give feedback that it is not recommended:

And

1 Like

Thanks everyone :slight_smile: i will take each item byitself

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