2 Replies Latest reply on Jun 8, 2009 3:10 PM by mrvodka

    Take lines of text from a field.

    typeleven

      Title

      Take lines of text from a field.

      Post

      I want to have a text field that has this information

       

      Customer Name

      618.555.1234

       

      then I want two other fields that can take the first line and then another field that has the second line so I have two fields like this...

       

      Name: Customer Name

       

      Phone:  618.555.1234

       

      How can I do this?

       

      also can I have it recognize that there is a pattern of ###.###.#### and take out the periods?

        • 1. Re: Take lines of text from a field.
          philmodjunk
             Filemaker gives us a rich list of text functions that can be used to do what you want, but why put two completly different types of data into the same text field? That doesn't appear to be the best possible approach.
          • 2. Re: Take lines of text from a field.
            mrvodka
              

            You can use an auto-enter calculation or if existing records, you can use replace field contents in your two new fields.

             

            GetValue ( YourCurrentField; 1 ) // Customer

            GetValue ( YourCurrentField; 2 ) // Number

             

            To check for a pattern try something like:

             

             

            Let ( [ f = YourPhoneField;
                    x = Substitute ( f; [0;"#"];  [1;"#"]; [2;"#"]; [3;"#"]; [4;"#"]; [5;"#"]; [6;"#"]; [7;"#"]; [8;"#"]; [9;"#"] );
                    y = "###.###.####"
                  ];
                     Case ( PatternCount ( x; y ); Middle ( f; Position ( x; y; 1; 1 ); Length ( y ) ) )
                )