cancel
Showing results for 
Search instead for 
Did you mean: 

How to assign acending numbers in priority in work queue

Miya
Level 5
Hi,

  I have a collection around some 15-20 rows have sorted  in the ascending order, i want to load them in the work queue with ascending priority eg: row1 --priority 1,row 2 priority 2 etc.. Can some one help on this scenario.

Regards,
Arthi

------------------------------
Miya
------------------------------
1 BEST ANSWER

Helpful Answers

Hi @Miya,

Create a logic to append Priority column inside your collection as shown below:

25518.pngOnce the Priority is available as column Name, then you can write the below logic to achieve the functionality:

  • Loop through the TestData collection (I am using TestData Collection in this example)
25519.png
  • Add row to the "QueueColl". This will be the collection which we will be adding to the queue.
25520.png
  • Copy the content of the TestData collection to QueueColl. Since the Start Row starts with 0 in a collection hence reducing 1 from it.
25521.png
  • Adding data to the queue
25522.png
  • Finally removing all rows from the QueueColl to loop through the second record.
25523.png
Hope it helps !!


    ------------------------------
    Manpreet Kaur
    Manager
    Deloitte
    ------------------------------

    View answer in original post

    3 REPLIES 3

    Hello Miya,

    You can create a Number data item called Priority. Keep this number incrementing in your loop.

    In your Load Queue action pass this Data item in the Priority input parameter. 

    This will keep incrementing your priority for each row and you will see items getting added to the queue with increasing priority order.

    25516.png

    ------------------------------
    If I was of assistance, please vote for it to be the "Best Answer".

    Thanks & Regards,
    Tejaskumar Darji
    Sr. Consultant-Technical Lead
    ------------------------------

    Hi,
       Thank You for quick reply, i have 1 issue when i add, add to queue each time all the rows in the collection added for eg for priority 1, adds priority 1 to all the 15 rows my requirement is row 1 shd have priority1 and row 2 have priority 2etc

    Regards,
    Arthi

    ------------------------------
    Miya
    ------------------------------

    Hi @Miya,

    Create a logic to append Priority column inside your collection as shown below:

    25518.pngOnce the Priority is available as column Name, then you can write the below logic to achieve the functionality:

    • Loop through the TestData collection (I am using TestData Collection in this example)
    25519.png
    • Add row to the "QueueColl". This will be the collection which we will be adding to the queue.
    25520.png
    • Copy the content of the TestData collection to QueueColl. Since the Start Row starts with 0 in a collection hence reducing 1 from it.
    25521.png
    • Adding data to the queue
    25522.png
    • Finally removing all rows from the QueueColl to loop through the second record.
    25523.png
    Hope it helps !!


      ------------------------------
      Manpreet Kaur
      Manager
      Deloitte
      ------------------------------