Question

How do I find values in a list searcher

  • 24 October 2017
  • 3 replies
  • 22 views

I have a list as structured below.

_list{0}.Name = Apple

_list{0}.list1{0}.code.value=1

_list{0}.Name = Banana

_list{0}.list1{0}.code.value=2

How do I search using a list searcher so that I want only the results for code.value=2?


3 replies

Userlevel 4
Badge +30

Hi @vemanamanu99,

I created a Workspace example.

  1. Read a shape file and build a list of attribute ( transformer ListBuild )
  2. Search a List value ( transformer ListSearcher )

Result is the List value that contain what i want.

 

In my example the List{1} has the value 2.

 

 

Thanks,

Danilo

Hi @vemanamanu99,

I created a Workspace example.

  1. Read a shape file and build a list of attribute ( transformer ListBuild )
  2. Search a List value ( transformer ListSearcher )

Result is the List value that contain what i want.

 

In my example the List{1} has the value 2.

 

 

Thanks,

Danilo

Thank you @danilo_inovacao, I will give a go ahead on this now and will reply back. :)
Userlevel 4

Are you searching for the fruit name and wanting the id, or are you searching for the id to get the fruit name?

If you're searching for "Banana" and want the associated fruit id, here's a possibility: Assuming that the nested list "list1{}" always has exactly one element, the attached workspace will return the value "2" in the attribute "Result".

banana-searcher.fmw

If you're looking for fruit id = 2, it's slightly more complicated since you have a nested list, which the ListSearch doesn't support. Here's a possible solution:

2-searcher.fmw

Reply