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 - Show more from this author
https://www.linkedin.com/in/marc-brunsman-4468a287/ |
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
Note: these functions are not guaranteed or supported by BrianDunning.com. Please contact the individual developer with any questions or problems.