Jump to content
Salesforce and other SMB Solutions are coming soon. ×

Checking for a value in a list.


FredP

Recommended Posts

I am using the list command to return a list of people associated with a certain task :

 

List (Task Employees::Name )

 

This might return a list of say:

Joe

John

Jim

Sally

 

What I would like to be able to do is check to see if a value exists in the list.

 

IE: Does Sally Exist in List (Task Employees::Name ) ?

 

Seems easy enough, but I have been away from Filemaker for a few months, and cannot remember how to go about doing this.

Fred

Link to comment
Share on other sites

Try:

 

patterncount(¶ & "Sally" & ¶; ¶ & list(Task Employees::Name) & ¶)

 

The pilcrows will eliminate false matches on substrings.

Link to comment
Share on other sites

Hmm, well it doesnt seem to be working for me. Is that pattern count expect a specific number of matches from the list?

 

So records may only have 1 entry in the list, others may have 20+.

Link to comment
Share on other sites

An easier way to check for the existence of a value in a value list:

 

If ( IsEmpty ( FilterValues ( field ; checkfor ) ); 0; 1 )

 

So Fred's usage would be:

 

If ( IsEmpty ( FilterValues ( List (Task Employees::Name ) ; "Sally" ) ); 0; 1 )

 

Although I would be assuming that the value being checked for would be coming out of a field or variable.

Link to comment
Share on other sites



×
×
  • Create New...

Important Information

Terms of Use