6 Replies Latest reply on Feb 2, 2010 6:17 AM by thomasseidler

    Import Records script step not updating matching records

    fcotani

      Summary

      Import Records script step not updating matching records

      Description of the issue

      FileMaker Product(s) involved:FileMaker Pro Advanced 10.0v3 Operating System(s) involved:Mac OS X 10.5.8This does not happen in v2.  Detailed description of the issue:In a scrip, when I try to use Import Records to update a matching record, the first time I press OK and then Import, the step turns to Add and not Update matching. Exact steps to reproduce the issue:1.  Create two tables related with a key field.2.  Create a script to update the second table using the key field as a matching field, using the Import Records script step.3.  Click OK and then Import.4.  You will notice that the script step appears like this:Import Records [No dialog; "filename"; Add; Mac Roman]5.  Again, click "Specify import order". The matching field signal has gone and the "Import Action" shows "Add new records" marked. Expected Result:Should be:Import Records [No dialog; "filename"; Update matching; Mac Roman] Actual Result:No matching records are updated. Exact text of any error message(s) that appeared:N/A Any additional configuration information/troubleshooting that is relevant to the issue:1.  Used to work fine before updating to version v3.2. Did not check to see whether it happens with FileMaker Pro 10. Workaround:Click "Specify import order" once more. In "Import Action" mark again "Update matching records in found set". In the field mapping, change again the signal of the two matching fields to show an equal sign. Then click OK and Import.

        • 1. Re: Import Records script step not updating matching records
          TSGal

          Francisco C. Otani:

           

          Thank you for your post.

           

          I am using FileMaker Pro 10.0v3 Advanced on an iMac running OS X 10.5.8.

           

          I am unable to duplicate the problem.  This is what I have done...

           

          1. With FileMaker Pro 10.0v3 Advanced, I created a new database file using the Contacts Management template.

           

          2. There is a relationship between the Contact Management and Notes tables based upon k_ID_Contact field.

           

          3. I entered several records into Contact Management, and added notes.

           

          4. I created a new script with the Import Records script step.  I specified the same database file, selected the option "Update matching records in found set", and set the k_ID_Contact field in both tables to match.  When I click OK, I'm presented with the auto-enter and repeating field options, and I click "Import".  My script step now says:

           

          Import Records [ "Contact Management.fp7" ; Update matching ; Mac Roman ]

           

          Is this happening with all of your database files or just one?  Any additional information you can provide may be helpful in narrowing down the possible causes.

           

          TSGal

          FileMaker, Inc.

          • 2. Re: Import Records script step not updating matching records
            fcotani
              

            TSGal,

             

            So far, it occurred two times with different databases. I could not find any reason for that behavior, but I am used to reuse scripts by copying and pasting them between files, and then modifying the steps accordingly. With the Import Records step, particularly, I always change the "Specify data source" to point to the desired file. But I am not sure whether this could be a possible cause.

            • 3. Re: Import Records script step not updating matching records
              LaRetta_1
                

              What it sounds like to me:

               

              You cannot script an import using 'update and add to' if there are no records in the target table to begin with.  You will need to add one record in the target table, create your script (which will THEN allow 'update and add to' and then delete the dummy record back out.  And no, we shouldn't need to do that when creating an import using a script but that's what we need to do.

              • 4. Re: Import Records script step not updating matching records
                thomasseidler
                  

                It just will not match the first record I import... it will create a second one and match that, and no more will be created, but then I have two of every record... Truly bizarre. If I find a workaround I will let you know. I suspect it may have to do with text types or some such strange thing - I'm matching by text based serial IDs like: AD0000001 etc

                 

                This does not make me a happy bunny, as it requires many hours dumping table contents (750k records across 4 different tables) and reimporting to try and get something working nice and cleanly without duplicate record creation.

                 

                Cheers, T 

                • 5. Re: Import Records script step not updating matching records
                  LaRetta_1
                    

                  Matching on text types shouldn't matter, even if one ID is number and the other is text (as long as the number field hasn't been changed to remove the leading zeros).  It would be helpful to know: 1) What type of file are you importing from, ie, fp7, txt, csv, mer, 2) Are you remembering to Show All Records before your import? 3) Do you have field-level validation in the target table (on that serial number) which might cause problems? 4) I would be concerned about only changing the target source.  Do you also go into the import map and make sure that a) you are on a layout matching the table occurrence target and b) make sure that the fields properly map to the target?

                   

                  Your opening post points clearly to no records being in the target when you first try to import - it will always change it back to 'Add New Records' only.  But it seems you have other issues as well.

                  • 6. Re: Import Records script step not updating matching records
                    thomasseidler
                      

                    thank you once again LaRetta, it was indeed Tom being stupid - mismatching import table/layout - I had wrong base table on import layout...

                     

                    Cheers, T