4 Replies Latest reply on Feb 18, 2014 4:28 PM by TomCichowicz

    Masking a field to another

    TomCichowicz

      Title

      Masking a field to another

      Post

           I'm trying to create a mask for data that I have in another field ...

            

               I have a field (email) that contains  "Doe,John(JDoe@domain.com)"

            

              I need to create a (new) calculation (text) field (MASK_email) that only contains "JDoe@domain.com"

               where can I find the info - or syntax to be able to just grab the data between the "( )" characters?

        • 1. Re: Masking a field to another
          philmodjunk

               Let ( [ FullEmail = YourTable::YourEmailAddressField ;
                         LeftP = Position ( FullEmail ; "(" ; 1 ; 1 ) ;
                         RightP = Position ( FullEmail ; ")" ; 1 ; 1 )
                        ];
                         If ( ( LeftP and RIghtP ) and ( LeftP < RightP ) ; Trim ( Middle ( FullEmail ; LeftP + 1 ; RightP - LeftP - 1 ) ) )
                      )

               It can be helpful to look up "functions" in FileMaker Help. Each of the above functions can be looked up by name in help to learn more about how they work.

          • 2. Re: Masking a field to another
            TomCichowicz

                 Thank you .. I will look up to learn how it does what it's doing....

                  

                   I understand the concept, but have a difficult time keeping track of what it's doing... I guess I just have to write down an example and go one step at a time to see the result.

            • 3. Re: Masking a field to another
              philmodjunk

                   The if function is to check that there really is a left and right parenthesis in your text and that the left paren is to the left of the right parenthesis.

                   The trim function removes any leading and trailing spaces so that

                   Doe,John(JDoe@domain.com)

                   and

                   Doe,John ( JDoe@domain.com )

                   will produce identical results.

              • 4. Re: Masking a field to another
                TomCichowicz

                     got it.

                      that is what I didn't understand what it was doing. (the "IF" statement.)

                      

                      thanks again.