cancel
Showing results for 
Search instead for 
Did you mean: 

Adding queue tags from content of the collection

JeremyRTDean
Level 5

I want to add a tag to each queue item from a field in the Collection that creates the queue.  In theory I can do this using the 'Tags' field in 'Add to Queue' and the formula [NLG Discontinued Stock Calculations.Product Group Manager Name].

However, BP takes the first item in the Collection and applies the value in that to all the queue item tags.

This example data set of 4,841 items contains multiple Product Groups but all queue items are tagged 'Whiteware', which just happens to be the first entry in the Collection.

Is this a bug or am I missing something?  I can work around it with filters and loops but that wouldn't be as elegant.

17840.jpg


------------------------------
Jeremy Dean
------------------------------
1 BEST ANSWER

Best Answers

harish.m
Level 12

HI Jeremy Dam,

It is working as expected. Since you are using Add to work queue action and passing the  column value  to tag for  all the items in the collection it wil take the first value in the collection and update it.




If you want to add unique tag  based on the value for one the column, Segregate differnet collections and  use multiple add queues actions to add the tags.

or 
If it is more dynamic - looping  the collection is the best option and  add work queue action inside the work queue to update the tag based on the column



------------------------------
-----------------------
If I answered your query. Please mark it as the "Best Answer"

Harish Mogulluri
Lead developer
America/New_York TX
------------------------------
----------------------- If I answered your query. Please mark it as the "Best Answer" [FirstName] [LastName] [Designation] [JobTitle] [City] [State] [Phone]

View answer in original post

4 REPLIES 4

harish.m
Level 12

HI Jeremy Dam,

It is working as expected. Since you are using Add to work queue action and passing the  column value  to tag for  all the items in the collection it wil take the first value in the collection and update it.




If you want to add unique tag  based on the value for one the column, Segregate differnet collections and  use multiple add queues actions to add the tags.

or 
If it is more dynamic - looping  the collection is the best option and  add work queue action inside the work queue to update the tag based on the column



------------------------------
-----------------------
If I answered your query. Please mark it as the "Best Answer"

Harish Mogulluri
Lead developer
America/New_York TX
------------------------------
----------------------- If I answered your query. Please mark it as the "Best Answer" [FirstName] [LastName] [Designation] [JobTitle] [City] [State] [Phone]

GopalBhaire
Level 10

Hi Jeremy

I hope you are using the tags as a way of categorizing, and there are only limited number of Group Manager for your dataset. And as you figured out already the option that you have in this case is to get all unique Group Managers and then loop over the unique value collection and filter the main dataset for each group and adding it into the queue, another option is to loop over each record create a single row collection and add it into queue.

Passing [collectionName.Field] will always take the value of the first row if not in a loop.

Thanks



------------------------------
Gopal Bhaire
------------------------------

Hello Jeremy,

Instead of adding the collection data to queue in one go, please loop the collection data one by one and add to queue.

Note: This solution may not work for large data 



------------------------------
Ram Prasad Gajula
Tech Lead
EY
Bangalore
------------------------------

Thanks Harish, and Gopal,

Makes sense.  Often in BP it is not clear where a function works for the entire data set or just one row.  Would be helpful if it was mentioned in the function notes but I guess we just need to experiment to find out.  I'm going to create a loop to look for the distinct entries, filter the data on those one-by-one and add the Tag as a group.  Would have been easier if this function loaded the queue taking the tag from each data row 🙂



------------------------------
Jeremy Dean
------------------------------