5 Replies Latest reply on Jan 28, 2009 1:47 PM by ellenkenney

    Merge address fields with carriage return?

    ellenkenney

      Title

      Merge address fields with carriage return?

      Post

      Hi,

       

      I have my address fields split now (ie first name, last name, street, city, etc).

       

      I tried making a script to copy and paste these fields into a new field so that it is easy to select the whole address at once, but I kept on getting extra blank lines in some of the records.

       

      Any other thoughts on how I could accomplish this?

       

      Thanks.

        • 1. Re: Merge address fields with carriage return?
          davidanders
            

          It is likely, if you go to those records, you will find that when the data was entered a return key was clicked.

          Manually removing the return would work, I am unsure how to script it, so it is automatic. 

          • 2. Re: Merge address fields with carriage return?
            TSGal

            ellenkenney:

             

            Thank you for your post.

             

            What is the format you'd like to display in the new field?  What extra blank lines are you getting?

             

            Here is one possible example....

             

            Suppose you want all the address information to appear in the Text field named "FULL", and you want it in the format:

             

            First Name Last Name

            Street

            City, State Zip/Postal Code

             

            A possible calculation formula would be:

            First Name & " " & Last Name & "¶" &

            Street & "¶" &

            City & ", " & State & " " & Zip

             

            Therefore, your script could be:

             

            Replace Field Contents [ No dialog; FULL ; <calculation from above> ]

             

            This is a simplistic case, but it may give you some ideas.  Also, you said you have some blank lines, so I'm assuming that some of the fields are empty, and you need to account for that in the calculation.

             

            If you can provide me an example with dummy data, and where you are getting the blank lines, I should be able to give you a solution.

             

            TSGal

            FileMaker, Inc. 

            • 3. Re: Merge address fields with carriage return?
              ellenkenney
                

              Yes, It must be the blank fields that are creating the blank lines. So I have a field for Company but if that is blank then the script still performs a carriage return.

               

              There are no extra carriage returns in the fields.

               

              Do you think there is a way to work around this? 

              • 4. Re: Merge address fields with carriage return?
                comment_1
                  

                ellenkenney wrote: 

                I have my address fields split now (ie first name, last name, street, city, etc).

                 

                I tried making a script to copy and paste these fields into a new field so that it is easy to select the whole address at once


                It's very easy to put them together, less easy to take them apart. I'd suggest you keep the separate fields and add a calculation field for the entire address.

                 

                The formula for the calculation could be along the lines of:

                 

                List (

                First Name & " " & Last Name ;

                Company ;

                City & ", " & State & " " & Zip

                 

                This will automatically remove any lines that are entirely empty. 

                 

                • 5. Re: Merge address fields with carriage return?
                  ellenkenney
                    

                  That worked perfectly!

                   

                  Thank you.

                   

                  Best,

                  Ellen