cancel
Showing results for 
Search instead for 
Did you mean: 

Filter collection based on specific value using (Data Item)

LorenzoCapocci1
Level 5
Hi Team,

Currently I am using a regular collection filtering using a loop stage but this is taking to long to go trough a list of 500 rows or more...
I was trying to use the collection filter, but, I need to use data item ( as value read as it changes for each page run,,,,) but I wasn't able to make work....

basically in document attached it is the current actions I am taking

Anything that doesn't match the value read in that moment should be just gone from collection list....


Is it possible to add Data (value read) in the Utility collection manipulation (Filter) so it allows to do this action at once, or do you have better solution to save time?
Thank you
36868.pngThis basically the start of the action to this loop
36869.png
6 REPLIES 6

NicholasHobbs
Level 3
Hi Lorenzo,

I think you can just use the Filter Collection action in the Utility - Collection Manupulation VBO.
The inputs are as followed:
Collection In: [collection name]
Filter: "colname = '"&[value]&"'" (you need single quotes around the data item [value])
where colname is the column in the collection you want to filter on.

LorenzoCapocci1
Level 5
Hi @NicholasHobbs,
Thank you for helping out, but could I ask to review the value please   
This is what I have based on my collection  ( added a screen shot of current view for data item current value and note...)
Column Name = EC-Level (OrdSup)
Data Item =  [Value Read]

"EC-Level (OrdSup)= '"&[Value Read]&' "

I have tried to review the " but Still getting this error, can you help again, please.. thank you
36859.png

NicholasHobbs
Level 3
Hi Lorenzo,

You need a double quote before the single quote at then end.

You have "EC-Level (OrdSup)= '"&[Value Read]&' "
It should be "EC-Level (OrdSup)= '"&[Value Read]&"' "

LorenzoCapocci1
Level 5
Hi @NicholasHobbs
I just copied "EC-Level (OrdSup)= '"&[Value Read]&"' "

and seems it is not liking the bracket I have in this , but this is what I have from the file and I can't remove from the original report, or maybe is there something else I am doing wrong? thank you very much once again


Internal : Could not execute code stage because exception thrown by code stage: The expression contains undefined function call Level().
36860.png36861.png
36862.png36863.png

NicholasHobbs
Level 3
@LorenzoCapocci1

You will also get an error with the column name because it has a space and () in.

I think you can put square brackets around the colname to fix this. 
"[EC-Level (OrdSup)]= '"&[Value Read]&"'"

I forgot about this in my previous answer.

LorenzoCapocci1
Level 5
Thank you @NicholasHobbs​ it worked perfectly, thank you so much for your help and time to get this sorted so quickly, I really appreciate!