August 25, 20178 yr 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
August 25, 20178 yr 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, 20178 yr by comment
August 25, 20178 yr 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"
August 25, 20178 yr I was under the impression that the OP wanted a list of the words that were colored "Green", 'Red" etc.?
August 25, 20178 yr 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!
Create an account or sign in to comment