Bot should upolad queue items if no items in the queue

Hi ,
I have a scenario where the bot should upload queue items if no items in the queue are available , any data is present in queue i don’t want to perform add queue , any approach ?

TIA

Hi @ishaanjain

Use the get queue items and filter the queues with new and pass the queue name into it and later place an if condition and give the condition as OutputQueue.Count>0 and in then block don’t place anything and in the else block place the add queue item activity and that works!!

Regards

Hi @ishaanjain ,

Use get queue items and get only items of new status by using the filter availble in the activity in the output variable check outputvariable of queuelist.count>0 says that u have items so dont upload , if its false then upload

Regards
sandy

@ishaanjain

  • Get Queue Items Count: Use the Get Queue Items activity to check if there are any items in the queue. Set the Top property to 1 to limit the number of items retrieved to just one, which is enough to determine if the queue is empty.
  • Decision Making: Use an If activity to check the count of the retrieved items. If the count is 0, proceed to add queue items.
  • Add Queue Items: If the queue is empty, use the Add Queue Item activity to add new items to the queue.

Hi @ishaanjain

Please check the below screenshot for your reference:

Regards

Hi @vrdabberu , @sandyarpa767 , Tx for reply i have a folowp question lets assume we are running the multibot architecture and need send a mail at the end of all the tx report how to achieve that , lets assume i am having 3 bots
1 bit 10tx
2nd bot 20tx
3rd bot 20 tx report ineed to send after all tx complete

@ishaanjain

isQueueEmpty = queueItems.Count = 0

Hi @ishaanjain To send a consolidated email after all transactions are completed in a multi-bot architecture, you can follow these steps:

  1. Create a Centralized Control Mechanism: Use a centralized database or a shared file to keep track of the status of transactions.
  2. Bots Update the Status: Each bot updates the status of their transactions in the centralized mechanism.
  3. Check Completion Status: After all transactions are complete, the last bot (or a separate monitoring bot) will send the email.

Hi @ishaanjain

->Take a count variable and assign that as 1
->As you have the queue item count in a variable(outputQueue) place an if condition and give the condition as count<=outputQueue.Count
->Increase the count by 1 at last of each transaction.
->So, when the bot recahes to final transaction then the condition of count = outputqueue gets satisfied and then place the send email activity in the then sequence so that bot send an email at last transaction only.

Regards

1 Like

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