Brian Dunning's FileMaker Custom Functions

AndSearchPortal ( text ; searchterm )

Use this function to filter results only with the found search term. This not OR search but AND search

  Be the first to rate this function Log in to vote

MarcNL   MarcNL - Show more from this author
https://www.linkedin.com/in/marc-brunsman-4468a287/

  Sample input:
AndSearchPortal ( "We would rather you say football instead of soccer." ; "football soccer" )
  Sample output:
True

  Function definition: (Copy & paste into FileMaker's Edit Custom Function window)

DESCRIPTION:
This function performs an "AND search" across a block of text. It returns TRUE only if **all** search terms appear at least once in the target text, regardless of their order or position. This is particularly useful when filtering related records in a portal using multiple keywords.

HOW IT WORKS:
- The function splits the search term string (e.g., "football soccer") into individual words.
- It checks each word to see if it appears anywhere in the given text.
- Only if **all** words are found, the function returns TRUE (1).
- If even one word is missing, the function returns FALSE (0).

USE CASE:
This function is designed to be used inside portal filters or conditional visibility calculations where you want a result to match **all** the provided keywords (like an advanced search with multiple criteria).

EXAMPLES:

AndSearchPortal (
"We would rather you say football instead of soccer." ;
"football soccer"
)
// Returns: TRUE (both terms found)

AndSearchPortal (
"We would rather you say football instead of soccer." ;
"football keeper"
)
// Returns: FALSE ("keeper" is not found in the text)

PARAMETERS:
- text: The field or text block you want to search within.
- searchTerm: A space-separated string of words you're searching for.

REQUIREMENTS:
- FileMaker 18 or later (uses the While function).

 

Comments

Log in to post comments.

 

Note: these functions are not guaranteed or supported by BrianDunning.com. Please contact the individual developer with any questions or problems.

Support this website.

This library has been a free commmunity resource for FileMaker users and developers for 21 years. It receives no funding and has no advertisements. If it has helped you out, I'd really appreciate it if you could contribute whatever you think it's worth: