Jump to content
Claris Engage 2025 - March 25-26 Austin Texas ×
The Claris Museum: The Vault of FileMaker Antiquities at Claris Engage 2025! ×

This topic is 4045 days old. Please don't post here. Open a new topic instead.

Recommended Posts

Posted

OK, so here's another thing that I thought I knew, but apparently I had remembered my results wrong.

 

Say you want to find something in a list of items like this:

$value = 'apple';
$multiValue = 'orange¶apple¶banana'

It was my recollection that you could use this statement: 

If ( $value = $multiValue ; 1 ; 0 )

to determine if the value 'apple' existed somewhere in the field or multi-value string/list.  That doesn't appear to work, even if the value being checked for is the first value in the list.  I would have sworn (I must swear a lot) that I had done this before.  But apparently not, because it doesn't work.

 

Instead I have resorted to using position(): 

If ( Position ( $multiValue ; $value ; 1 ; 1 ) > 0 ; 1 ; 0 )

Any other techniques for checking the existence of a value in a list?  Something that is faster?

 

Thanks,

C

Posted

Try:

not IsEmpty ( FilterValues ( $Value ; $multiValues ) )

Position() can give false positives because it can match partial words.

This topic is 4045 days old. Please don't post here. Open a new topic instead.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.