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 3922 days old. Please don't post here. Open a new topic instead.

Recommended Posts

Posted

I'm embarrassed to post this but trust me, I've exhausted searching the internet for strategies.  Surely, with Filemaker Pro 12 there must be a way to create a function that looks to an existing text field and searches for a specific string?!?  'Products' would contain none or some or all of A  B  C  D  E , in a random order.  I would like to create a calculation that searches for 'B' and returns a text expression (there is no "contains" function).  I can't think it should be so difficult, I must be using the wrong terminology?  ('B' is just a representation of a longer name, ie. "cookies" or "twinkies" could be the products ...)

Thanks!

Lance

Posted

function that looks to an existing text field and searches for a specific string

 

Have a look at the PatternCount() function.

 

 

The bigger question here is why do you have a field that contains multiple values. That's not a good strategy.

Posted

Lance, is this a LIST (return delimited values)? if so, perhaps the list functions would help find a "match". You can return a "string" to a variable and/or field and/or dialog - however you make the match by script. Calculation could also return a string if there is a match. PatternCount() helps if you have unique enough values in the field (even multiples of the same phrases).

Posted

Have a look at the PatternCount() function.

 

 

The bigger question here is why do you have a field that contains multiple values. That's not a good strategy.

You're absolutely correct.  This field is a result of another system export, so there's not much control over that.  In fact, my whole issue is to extract a specific product (in this case) and thus render the 'multi-variable field' non-critical:)

Thanks everyone, I'll give "PatternCount()" a try!

Posted

This field is a result of another system export, so there's not much control over that.  In fact, my whole issue is to extract a specific product (in this case) and thus render the 'multi-variable field' non-critical:)

Thanks everyone, I'll give "PatternCount()" a try!

 

Beverly is correct that (with return-separated values) it is better to test for:

not IsEmpty ( FilterValues ( "searchString" ; YourField ) )

This eliminates false positives such as when searching for "cat" in a field that contains "catalog". If your field is not return-separated, use the Substitute() function to replace the existing delimiter with ¶.

  • Like 2

This topic is 3922 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.