FredP Posted March 26, 2008 Share Posted March 26, 2008 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 More sharing options...
Ender Posted March 26, 2008 Share Posted March 26, 2008 Try: patterncount(¶ & "Sally" & ¶; ¶ & list(Task Employees::Name) & ¶) The pilcrows will eliminate false matches on substrings. Link to comment Share on other sites More sharing options...
FredP Posted March 26, 2008 Author Share Posted March 26, 2008 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 More sharing options...
Ender Posted March 26, 2008 Share Posted March 26, 2008 My bad. Try it the other way around: patterncount(¶ & list(Task Employees::Name) & ¶; ¶ & "Sally" & ¶) Link to comment Share on other sites More sharing options...
David Head Posted March 26, 2008 Share Posted March 26, 2008 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 More sharing options...
FredP Posted March 26, 2008 Author Share Posted March 26, 2008 Yeah its a dynamic field value that we are searching for, but thanks, I will try your approach! Fred Link to comment Share on other sites More sharing options...
FredP Posted March 26, 2008 Author Share Posted March 26, 2008 That worked great. thank you! Fred Link to comment Share on other sites More sharing options...
Recommended Posts