hutchlad Posted August 25, 2017 Posted August 25, 2017 Hey Guys, I'm basically looking to extract information from a field. So lets say I have a field called "Tags" and for arguments sake, let's say the field contains color string inside, IE "Red Blue Black Green Purple Orange" Now if I wanted to check if the field contained the word "Green" within the string and if it DOES contain it, then to RETURN that result and set it into a field somewhere? So the result of the calculation would be "Green" I'm sorry if thats unclear, but I need to find a way to do this, to check for and extract a certain word from the "Tags" field which is a long string of text (different words) Thanks in advance
comment Posted August 25, 2017 Posted August 25, 2017 (edited) 1 hour ago, hutchlad said: check if the field contained the word "Green" The problem with this requirement is the word "word". It is very easy to check if the field contains the string "Green", using either the PattternCount() or the Position() function. The problem is this could easily return a false positive answer if the field contains another word that contains the given string - e.g. "Evergreen" or "Greenfield". If this is a "Tags" field, I would suggest you change it to use a return-separated list of values. That is a data type that Filemaker recognizes and provides tools to work with. You can easily test for the presence of an item in such field by doing = FilterValues ( "Green" ; Tags ) The result will be "Green" when Tags contain the value "Green" , empty otherwise. The search is not not case-sensitive, but items like "Greens" or "Greeny" will not be considered a match. Edited August 25, 2017 by comment
bruceR Posted August 25, 2017 Posted August 25, 2017 Comment, a request for clarification. Perhaps I missed something. I understand how "Greens" will not be a match, when using the return-separated list, filterValues approach. But it seems to me that "Green" would match "Green"
comment Posted August 25, 2017 Posted August 25, 2017 This auto-correct feature can be pesky at times.
Lee Smith Posted August 25, 2017 Posted August 25, 2017 I was under the impression that the OP wanted a list of the words that were colored "Green", 'Red" etc.?
comment Posted August 25, 2017 Posted August 25, 2017 Just now, Lee Smith said: I was under the impression that the OP wanted a list of the words that were colored "Green", 'Red" etc.? I hope not!
Recommended Posts
This topic is 2912 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 accountSign in
Already have an account? Sign in here.
Sign In Now