Brian Dunning's FileMaker Custom Functions

ContainsValue ( listToSearch ; startIndex ; value )

Indicates if a list contains the specified value.

  Average rating: 4.1 (29 votes) Log in to vote

Andres Cabezas   Andres Cabezas
Domador Software
http://www.domador.net

Share on Facebook Share on Twitter

  Sample input:
ContainsValue ( "white¶blue¶red" ; 1 ; "blue" )
  Sample output:
1

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

ContainsValue ( listToSearch ; startIndex ; value )

Inputs:
listToSearch : A carriage-return delimited list in which to look for a value.
startIndex : Position in the list at which to start looking for the value. Use 1 to start at the first element in the list.
value : Value for which to search.
Outputs:
1 if the list contains the specified value, 0 if the value is not in the list.

The startIndex parameter is required because of the recursive nature of this function.

This function requires FileMaker 8.0 or higher.

 

Comments

Agnès   Agnès, France
Dec 28, 2013
Hello,

May be just

Not IsEmpty ( Filtervalues ( ListToSearch ; Values ))
or
PatternCount ( ¶ & ListToSearch & ¶ ; ¶ & Values & ¶ ) > 0

give the same result.

And to target values​​, could be MiddleValues ( ListToSearch ; 5 ; ValueCount ( ListToSearch ) ) instead of ListToSearch
 

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.

Under construction. Email me your wish list for improvements.