Forum Discussion

mlee's avatar
mlee
Frequent Visitor
7 years ago

SEARCH function using a dynamic list of find text values

I'm looking a way to filter out rows of a table using SEARCH. Similar to this question I hardcoded the search criteria in previous solutions. 

 

However, I have a new requirement where I have dynamic values to search for.

 

For example, if a related table has values "cat", "dog", "fish" I want to avoid this:

 

SEARCH("*cat*", 'Table[AnimalName], -1) >=0 || SEARCH("*dog*", 'Table[AnimalName], -1) >=0 || SEARCH("*fish*", 'Table[AnimalName], -1) >=0

 

The terms cat, dog, and fish are stored in another table and easily referencable. Is there a way to search a column of values?

 

Thanks,

 

Mike

4 Replies

  • Hi,

    The RELATED() or LOOKUPVALUE() function should work.  To get more specific help, share your data and show the expected result.

    • mlee's avatar
      mlee
      Frequent Visitor

      Here is a an example of some data and what I'm trying to accomplish:

       

      Element_Table

       

      ModeIdElementName
      18 inch window
      16 inch window
      1Brown chair with casters
      1Bi-fold door black
      28 inch window
      27 inch window
      2Orange chair with casters
      2Bi-fold door black
      38 inch window
      3Bookscase cedar
      3Brown chair with casters
      3Bi-fold door black

       

      Search_Table

       

      ModelIDSearch term
      1wind
      1inch
      2wind
      2inch
      2black
      3case
      3cedar

       

      What I need to do is for each ModelId is to count how many matches there are in the Element_Table. For example, for modelId =1 I would search all elements with modelid=1 and any elementname's which contain the word "wind" or "inch". Since the search terms are often just partial words they will need to be wildcard searches.

       

      Mike

       

       

      • Ashish_Mathur's avatar
        Ashish_Mathur
        Super User

        Hi,

        What exact result are you expecting?  In which Table should the result appear?