Video Screencast Help
Search Video Help Close Back
to help
New in the Rewards Catalog: Vouchers for "Symantec Technical Specialist" and "Symantec Certified Specialist" exams.

What is the best way to find item in array

Updated: 21 May 2010 | 2 comments
neil_rogers's picture
0 0 Votes
Login to vote

I have an array that has 150 computers and guids in it. Computers_result[*].guid and Computers_result[*].name. I want to find the guid for the computer named NSbox. I can loop through the array and remove one at a time with a "Get Item from Index", and an equals rule, set it to a variable for the next step, but seems like there should be a component that will loop through an array or a different way to handle finding what the guid is.

Neil Rogers

discussion Filed Under:

Comments

rhamner's picture
10
Aug
2008
0 Votes 0
Login to vote

Configurable Collection Filter

The component you're looking for is Configurable Collection Filter. First you specify the data type, input array variable, and whether you want to create a new variable with the result or remove the filtered items from your input variable. Next you have a Filter Model that is run on each item in the array where you can put your logic of whether to keep the item or not. In this model you have a special variable called Element that is the current item in the array that is being tested. In your case you would use a Text Equals Rule and your Compare Variable would be something like Element.name.

neil_rogers's picture
14
Aug
2008
0 Votes 0
Login to vote