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:
 
When you choose this file or source
In the Specify File dialog box, choose the file you want to import, or type file paths directly into the list. Specify one path per line. FileMaker Pro will use the first path it locates as the file to import. See Creating file paths.
In the Folder of Files Import Options dialog box, choose the folder of image or text files that you want to import, or type the folder paths directly into the list. Specify one path per line. FileMaker Pro will use the first path it locates as the folder to import. For more information, see Importing a folder of files all at once and Creating file paths. This option is not supported from scripts running on FileMaker Server.
In the FileMaker Pro Photo Import Options dialog box, choose your camera or other image device, and choose how you want to download and import the photos. For more information, see Importing photos from a digital camera or other device (Mac OS). This option is not supported from scripts running on FileMaker Server.
Bento Data (Mac  OS)
In the Select Bento Source dialog box, select the library and collection from that library that you want to import, then select field mapping options. For more information, see Importing Bento data (Mac OS). This option is not supported from scripts running on FileMaker Server.
In the Specify XML and XSL Options dialog box, choose the source of the XML data that you want to import, and choose an XSLT style sheet if you want to apply one prior to import. The XML and XSLT source may be a file or the result of an HTTP request, or a calculation that generates a file path or an HTTP request. For more information, see Importing XML data.
Specify the data source name and location, the user ID and password (if any), and the SQL query to be executed. You can enter a query directly or specify a calculation to generate the query. For more information, see Automating ODBC import using the Import Records script step.
Note  If you use the Import Records script step to import ODBC data that contains Unicode strings, your ODBC driver must support Unicode. Otherwise, the results may be inconsistent.
  •
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 
This script step is:
  •
  •
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 use this script step to import an XML data file:
  •
  •
  •
use different syntax for Windows and Mac OS. For Windows, follow the syntax file:///[full path to file]. For Mac OS, follow the syntax file:///volumes/[full path to file]. If you use a variable in the file path, it must generate the proper syntax.
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
  •
When using the Import Records script step or Export Records script step in a FileMaker Server scheduled script, keep the following in mind:
  •
Any specified file must be in the FileMaker Server Documents folder, the temporary folder, or a child folder of either the FileMaker Server Documents folder or the temporary folder. For example, the following are all valid paths for file.csv:
<Documents>/file.csv
<Temporary Path>/file.csv
<Documents>/Folder1/file.csv
<Temporary Path>/Folder1/Folder2/Folder3/Folder4/file.csv
  •
Any path specified that isn’t a complete path to the file (for example, anything other than
/Library/FileMaker Server/Data/Documents/<0 or more directories>/<filename> ) is evaluated as being relative to the temporary path.
  •
  •
For FileMaker Pro, if an absolute path is not specified in a script that will be executed from FileMaker Pro, the path is assumed to be relative to the location of the database file from which the script was run. For example, if a script containing the Export Records script step is run with the pathname file:/export.tab, and the file running the script is /MyFiles/Library/Books.fp7, the exported file will be created as /MyFiles/Library/export.tab.
Examples 
Go to Layout ["Layout #4"]
Import Records [No dialog; "Contacts"; Add; Mac Roman]
Related topics 
Export Records script step
Script steps reference (alphabetical list)
Script steps reference (category list)