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.
Bento Data (Mac OS)
If the Bento database you want to import has a password, enter it in the Bento Password dialog box. In the Select Bento Source dialog box, select the library and collection 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 
 
Where the script step runs 
Supported 
FileMaker Pro 
Yes 
FileMaker Server scheduled script 
Partial 
FileMaker Go 
Partial 
Custom Web Publishing 
No 
Instant Web Publishing 
No 
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 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.fmp12, the exported file will be created as /MyFiles/Library/export.tab.
 •
If you are using a calculation that generates the file path for the XML file, you need to use the format used by the operating system for the full path. For example, the following are valid paths if you are using calculations to generate the path for the XML file for Windows or Mac OS:
Mac OS: /Volumes/VolumeName/directoryName/fileName
Windows: driveletter:/directoryName/fileName
If you are providing a cross-platform solution, you can use the Get(SystemPlatform) function to identify the current platform and use the correct format for each platform.
 •
 •
If a script created in an earlier version of FileMaker Pro contains an Import Records [Digital Camera] script step, the step is commented as obsolete. You can remove the step, but you can’t edit it.
 •
If a button references an Import Records [Digital Camera] script step, the button is disabled and the Import Records script step is commented as obsolete in the Button Setup dialog box.
 •
FileMaker Go only supports importing from one FileMaker Pro file to another FileMaker Pro file.
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)