4 Replies Latest reply on Oct 15, 2012 7:42 PM by LaRetta

    How do I perform repitive, sequential entries in a field

    medused

      I imported an excel spreadsheet of inventory to filemaker 12 pro. Their are 400 records and no ID #'s for each item assigned in the spreadsheet.

      How do I create a way to add sequential ID#'s in the data base, without having to repetively type in 400 #'s individually., now that I converted the spreadsheet to a product database?

       

      Thank you.

        • 1. Re: How do I perform repitive, sequential entries in a field
          StephenWonfor

          Medused

           

          1,Show All records.  Drop cursor in ID field.  Select REPLACE from records menu  - replace with sequentials.

           

          or

           

          2.  Script it.

           

          Show All Records. 

          SetVariable ($Count; 1)

          Go First Record. 

          Loop.  

               SetField(ID: $Count)

               SetVariable ($Count; $Count + 1)

               Go Next (exit after last)

          End Loop

           

          Stephen

          • 2. Re: How do I perform repitive, sequential entries in a field
            Malcolm

            How do I create a way to add sequential ID#'s in the data base, without having to repetively type in 400 #'s individually., now that I converted the spreadsheet to a product database?

             

            Create a new field and set the options to be a serial number. Put the field onto a layout and use the replace function to set the serial numbers.

             

            Malcolm

            • 3. Re: How do I perform repitive, sequential entries in a field
              gwinzeler

              Easiest way is to first define the table in FileMaker with seq# and then do the import to that table.  If you already did the import just use that table delete all records create seq# field the re-do import to that table.

               

              Good Luck

              GARY

              • 4. Re: How do I perform repitive, sequential entries in a field

                The fastest way I've found is to (back up first) change the serial number from number to type calculation (result is number):   Get ( RecordNumber )

                 

                Do NOT make it unstored ... exit out of definitions and make note of the table total count. Because calc is stored, it's value plants into the fields. Then go back to definition and change back to regular number ... value will remain.  Set the auto-enter serial to total count + 1.

                 

                It handles all records without showing all records first which wasn't mentioned (but needed) with the other techniques.  You don't have to find the field on a layout or create script.  It also respects the natural sort order of creation even if the table or relationship is sorted.  It is much faster than setting a field but beware of record locking.  Working in definitions when users are in system is risky anyway; best to avoid it.

                 

                :-)