6 Replies Latest reply on Mar 7, 2013 9:17 AM by ohnoes

    not sure how this script works

    ohnoes

      Hi

       

      attached image of script written for me

       

      the purpose was to group together in one list the contents of

       

      it was supposed to gather the (return separated) email addresses from a field in a group of records and then put them all together in another field

       

      but it behaves strangely and contains emails that have long been deleted from the original fields

       

      Only wnat it to reflect the current contents of the email field

       

      not sure if i've posted this query in the right place or if this makes any sense but would much appreciate any advice, see image of script below

       

      John

       

       

      Screen shot 2013-03-07 at 12.51.31.png

        • 1. Re: not sure how this script works
          mikebeargie

          There is nothing in this script performing a query (find), so if you're going to the this contact admin layout and it shows all records, then this is pulling ALL email addresses that exist in the database.

           

          I am assuming:Contacts::Email List is a global field (one value stored for all records).

           

          There is nothing that would be making up old or deleted data though. If an email appears in the list, then it is stored in your data somewhere and you need to make sure to review and cleanup the CONTACTS::email field.

           

          I would creating a review layout in Table view that just has the CONTACTS::email field stretched out so you can see all the contents clearly.

          • 2. Re: not sure how this script works
            ohnoes

            Mike

             

            Thanks for your reply much appreciated

             

            Yes,  Contacts::Email List  is a global field

             

            you said..... If an email appears in the list, then it is stored in your data somewhere and you need to make sure to review and cleanup the CONTACTS::email field....."

             

            do i understand correctly then, that the emails presented in the  Contacts::Email List  field can only come from the Contacts::Email  field  ( ie they are not being scooped up from any other fields in the db )

             

            Best

             

            John

            • 3. Re: not sure how this script works
              RayCologon

              Hi John,

               

              The script you've posted might be said to be a little idiosyncratic, but as Mike says, the data it places into the CONTACTS::Email list field (and subsequently, onto the clipboard) is all coming from the CONTACTS::email field in the found set. The step that is doing that work is the one on the eighth line:

               

              • Set Field [CONTACTS::Email list; Case(not IsEmpty(CONTACTS::Email list);CONTACTS::Email list & "¶") & CONTACTS::Email]

               

              As you can see, the only field other than the CONTACTS::Email list field that the calculation on this step references is the CONTACTS::Email field.

               

              Bear in mind that the CONTACTS::Email field, being a text field (presumably), may hold multiple lines of data, and it's possible that in the normal course of things (until you click into a field on a given record) you're only seeing the first line. That will also be the case in Table view, so it may not be obvious where the 'old' data resides. As a first step, I suggest you perform a find (in the CONTACTS::Email field) for one of the addresses you thought were deleted, to see where it's lurking.

               

              Regards,

              Ray

              ------------------------------------------------

              R J Cologon, Ph.D.

              FileMaker Certified Developer

              Author, FileMaker Pro 10 Bible

              NightWing Enterprises, Melbourne, Australia

              Email: cologon@nightwingenterprises.com

              http://www.nightwingenterprises.com

              ------------------------------------------------

              1 of 1 people found this helpful
              • 4. Re: not sure how this script works
                mikebeargie

                yes you are correct, it is only pulling values from CONTACTS::email. Any errant values you get in your final result are coming from that field in your found set of records the script compiles the list for.

                1 of 1 people found this helpful
                • 5. Re: not sure how this script works
                  ohnoes

                  Thanks again Mike

                  Appreciate you taking the time

                  John

                  • 6. Re: not sure how this script works
                    ohnoes

                    Thanks Ray

                    I appreciate your help

                    John