5 Replies Latest reply on Apr 17, 2014 9:05 AM by philmodjunk

    Importing/Duplicates/Combining Files

    BrettSahler

      Title

      Importing/Duplicates/Combining Files

      Post

           I am using the pre made contacts database and have added a field called Mailing list with six different values that have check boxes next to them.  The values are artists names.  The current database has a check mark next to ARTIST 1  for every contact in the database.  I am now importing a list of names and after import I add a check mark to ARTIST 2 using "Replace Field Contents"    This is where I get stuck.  

           I have a script to find duplicates...  but what really needs to happen is for any duplicates it needs either combine the records that match or add a "check" in Artist 2 on the original record.  

           Any help is much appreciated.

            

            

        • 1. Re: Importing/Duplicates/Combining Files
          philmodjunk

               "combine" the records in what way exactly?

               Set Field [YourTable::Mailinglist ; List ( YourTable::Mailinglist ; "Artist 2" ) ]

               Is a script step that can append "artist 2" to the end of a return separated list. If "Artist 2" is a specified value in a value list specified for the field's check boxes, this will check the Artist 2 check box while leaving all other selections un modified.

               Note: Sorting your records by the field into which you entered the ! in order to find duplicate records will group the duplicates so that they are adjacent to each other. GetNthRecord can then be used to refer to data in a second duplicate record so that a script step can combine the data in that field  of the duplicate record with data in a field in the current record.

          • 2. Re: Importing/Duplicates/Combining Files
            BrettSahler

                 I am using the following script to identify duplicates.  Unique ID is "First&Last&email"

                 So after I run this script, I have a set of duplicate records that have an "x" in the Mark Field.   Because I am going to be doing this so often, it would seem that It would be easier to put another "Y" in the Mark field on the original record that has a dupe and then just add the check box next to Artist 2..

            • 3. Re: Importing/Duplicates/Combining Files
              philmodjunk

                   GetNthRecord can then be used to refer to data in a second, adjacent duplicate record so that a script step can combine the data in that field  of the duplicate record with data in a field in the current record.

                   But be careful that you don't have more than two duplicate records in a given set of duplicates. If so, this gets more complicated.

              • 4. Re: Importing/Duplicates/Combining Files
                BrettSahler

                     1.  So I am trying to find GetNthRecord in the scripts database and can't find in Filemaker pro 13?  Looked by Category and by Name?

                     2.  Can the GetNthRecord be set up as an additional script that can run on my set of found, duplicates that have the x in the mark field, or do I need to add it to the Find Duplicates Script?

                      

                      

                      

                • 5. Re: Importing/Duplicates/Combining Files
                  philmodjunk

                       It's not a script step, it's a function used in a calculation such as:

                       Set Field [YourTable::Field ; List ( YourTable::Field ; If ( Get ( RecordNumber ) < Get ( FoundCount ) ; GetNthRecord ( YourTable::Field ; Get ( RecordNumber ) + 1 ) ) ) ]

                       Which copies data from the next record in the found set and appends it to the same field in the current record separated by a return.