Import Records
Purpose 
Imports records from another file or data source you specify.
Format 
Import Records [No dialog; “<source or filename>”; Add/Update existing/Update matching; <platform and character set>]
Options 
 •
Perform without dialog prevents display of import-related dialog boxes when the script step executes. However, if a data source file has not been specified, the Open File dialog box will be displayed when a script is run from FileMaker Pro.
 •
Specify data source lets you choose the file or source of the data to be imported. Depending on the file or source you choose, a dialog box may appear for specifying the following additional options:
 
 •
Specify import order tells FileMaker Pro to use a predefined import order. The last import order used in the file appears as the default and can be edited. This option also lets you choose whether to keep repeating field data together or to split repeating fields into separate records, as well as whether to add new records, replace data in the current found set, or import data as a new table.
Note  When import source fields and target fields are mapped using matching names, field name matching is performed dynamically each time the script step is performed.
Compatibility 
 
Where the script step runs 
Supported 
FileMaker Pro 
Yes 
FileMaker Server scheduled script 
Partial 
FileMaker Go 
Partial 
Custom Web Publishing 
No 
FileMaker WebDirect 
Partial 
Runtime solution 
Yes 
Originated in 
FileMaker Pro 6.0 or earlier
Description 
You can set the import order and use the Specify import order option, or perform this script step with the dialog box so the user can set new criteria, such as importing data as a new table.
If the source file is open, the found set is imported; if not, all records in the source table are imported.
When you include this script step in a FileMaker Server scheduled script and you do not select Perform without dialog in the Edit Script dialog box, the text (NOT compatible) appears after the script step. The script, however, will run. The behavior will be the same as if Perform without dialog was selected. See Get(DocumentsPathListing) function for more information.
If you schedule a FileMaker Server script to do any of the following, you will receive an error:
 •
 •
 •
Notes
 •
 •
<Documents>/file.csv
<Temporary Path>/file.csv
<Documents>/Folder1/file.csv
<Temporary Path>/Folder1/Folder2/Folder3/Folder4/file.csv
 •
 •
 •
 •
 •
 •
 •
 •
 •
 •
 •
FileMaker WebDirect does not support the Perform without dialog or Specify data source options.
 •
Example 1 
Imports information from New Product Catalog.xlsx as new records without prompting the user.
Go to Layout ["Products"]
Import Records [No dialog; Source: "New Product Catalog.xlsx"; Worksheet: "Stock"; Add; Mac Roman]
Example 2 
Updates existing records with information from New Product Catalog.xlsx.
Go to Layout ["Products"]
Sort Records [Restore; No dialog]
Go to Record/Request/Page [First]
Import Records [No dialog; Source: "New Product Catalog.xlsx"; Worksheet: "Stock"; Update matching; Mac Roman]
Example 3 
Sets the next serial value after importing records. Useful when Perform auto-enter options while importing is not selected to preserve dates and other auto-entries.
Go to Layout ["Products"]
Import Records [No dialog; Source: "New Product Catalog.xlsx"; Worksheet: "Stock"; Add; Mac Roman]
Set Next Serial Value [Invoices::Invoice ID; Get ( TotalRecordCount ) + 1]
Sort Records [Restore; No dialog]
Go to Record/Request/Page [First]
Related topics 
Set Next Serial Value script step
Export Records script step
Script steps reference (alphabetical list)
Script steps reference (category list)