2 Replies Latest reply on Apr 1, 2014 1:16 PM by aklobby

    Search String Not Recognized

    aklobby

      Title

      Search String Not Recognized

      Post

           I am running a script that calls an If statement to determine if a search string exists in a field then set field in another field. This works great with some search strings but not all. The example of the working search string if statement is: 

            If[datafield = "GN2008"]

           Set Field [newfield; 1]

           End If

           The one that does not work is:

             If[datafield = "GN04"]

           Set Field [newfield; 1]

           End If

           Not sure why this will not recognize the shorter string. If I perform a find with that criteria filemaker finds those records, but the if statement and a substitute function do not recognize the string. 

           Any insight is most appreciated. 

           Allison

        • 1. Re: Search String Not Recognized
          philmodjunk

               Is it the same field in both cases? If the second example is for a different field, check to see if it is defined as a text or number field. If it's a number field, this may not work.

               The next possibility is that datafield contains "GN04", but there is additional, possibly invisible text in the field. If so, a find will find the record but if you click into the field and try to highlight the contents, you may find that there is also a space or return character in the field.

          • 2. Re: Search String Not Recognized
            aklobby

                 PhilModJunk, 

                 Thank you for helping me find the invisible spaces. 

                 Allison