Skip to main content

I am currently looking for a way to query a list to either return all the values that contain the value found in an attribute or return the list index for these values.

 

I have currently managed to return the list index for the first value in the list to meet this query using a ListSearcher but can't seem to figure out how to return all values.

 

If you don't want to explode the list (and you probably don't looking at the length) then you're probably looking at a python solution


@declancoleman1​  I agree with @ebygomm​  You'll probably have to develop a short Python script. There is a simple example that is part of the Advanced Attribute and List Handling Course, at the end of the chapter Transformers for Working with List Attributes - section Python & List Attributes and the example workspace Python_example_2020.fmwt


If you are like me and too bad/too lazy to write Python then an alternative would be as below.

 

This is the quickest way I know of that is stock Transformer based. You can minimise the amount of processing time that ListExploder takes by first removing all attributes that aren't absolutely needed using an AttributeRemover, leaving just a Unique Row ID and the List to Search itself.

capture

 

 

In this example I just kept it simple and searched for a RegEx expression of "1" and it returned in a Separate List all the List Indices that had the value of 1

capture1


@declancoleman1​  I agree with @ebygomm​  You'll probably have to develop a short Python script. There is a simple example that is part of the Advanced Attribute and List Handling Course, at the end of the chapter Transformers for Working with List Attributes - section Python & List Attributes and the example workspace Python_example_2020.fmwt

@Mark Stoakes​ just a note that the Links and Attachments on those two pages are unfortunately broken :(


This did the trick perfectly thanks a lot!


Reply