Set Data >>>Work Queue

Keerti

New Member
Hi ,

I am following Foundation Course PDF for learning. I am stuck at "Set Data" Feature categorised under "Work Queues". I want to know, how does it works and in what scenarios can it be used ?

Many Thanks !!
:)
 

VJR

Well-Known Member
Hi Keerti,

If you are having data in a collection called as InputCollection which you would be using to insert data into the Queue via the 'Add to Queue' action.
Assuming this InputCollection has 3 columns (Name, Age, City) which has data in all its columns. Now you want to have a new column in the collection called as 'Remarks' where you want to add some notes or comments or even can be used to save some data related to your process. (This column is the 'Narrative' column in the Foundation course).
This column will have no data in it during design time and now if you want to have some data in this column at the same time when each item of the queue is being processed (at run time), then you can make use of the 'Set Data' action.
You can see there is another collection that is returned on 'Get Next Item'. Lets call it 'RetrievedData'. This data always has 1 row of data at a time (ie; the row currently being processed by the queue).

-Now in order to add data to this new 'Remarks' column of the RetrievedData collection you need to use a Calc stage (just like you set something to a data item).

-Although the Calc stage has now updated the data to the collection, but the queue is not updated with it.
(You can check by using a 'Get Item Data' action after the Calc stage. If you see the output parameter of this action, it returns a collection. See the last one in the output parameter list. Lets call it GetItemDataCollection. After pressing F10 on this action if you open GetItemDataCollection then it will not have the updated Remarks column even though you updated the collection using the Calc stage above.)

-In order to update this data to the queue, after the Calc stage you will be using 'Set Data' where you will be passing the 'RetrievedData' collection and the 'Item ID' that was obtained from 'Get Next Item'.

- Now after 'Set Data' again use a 'Get Item Data' action and see that the resulting GetItemDataCollection will now have the updated Remarks column which you originally updated using the Calc stage. (What you do with the Remarks column or with this updated GetItemDataCollection is totally upto you and the logic of the process).
Also read the 'Conditions' tab of the 'Set Data' action properties.

As a one liner, 'Set Data' is used to save or commit data from the updated collection back to the queue :).

It is a bit tricky to understand but hope it makes it clear.
 
Top