Export Records
Purpose 
Exports records to a specified file.
Format 
Export records [No dialog; “<output filename>”; Automatically open; Create email; <platform and character set>]
Options 
 •
Perform without dialog prevents dialog boxes from displaying when the script step is run from FileMaker Pro. These dialog boxes would let the user set new export criteria.
 •
Select Specify output file or click Specify to display a dialog box where you can specify the file and file type to export. Choose the folder you want to export to, or type the folder path directly into the list. Specify one path per line. FileMaker Pro will use the first path it locates. See Creating file paths. The file type you use depends on the import requirements of the program using the exported data. You can also specify options to Automatically open the file and Create email with the file as attachment after saving.
Note  You can export records as a Microsoft Excel worksheet by choosing Excel Workbooks (.xlsx) from the File Type list. Export to .xls requires Rosetta, which is not available on some versions of Mac OS X. For more information on saving FileMaker Pro files as Excel files, see Saving and sending records as an Excel file.
If you specify XML as the export file type, the Specify XML and XSL Options dialog box appears, where you can specify an XML grammar and choose an XSLT style sheet if you want to transform the XML. The XSLT source may be a file, the result of an HTTP request, or a calculation that generates a file path or an HTTP request.
Note  Do not export fields whose name is entirely numeric (such as "2") or whose name is a single-byte kana character (Japanese version) using the FMPDSORESULT grammar.
 •
Select Specify export order or click Specify to use the export order that was in effect when you added the script step. The last export order used in the file appears as the default and can be edited or deleted. If necessary, choose an output file character set from the list. Select Apply current layout’s data formatting to exported data, or the formatting of the last exported data will be used.
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 export order before adding this script step, or perform the step with a dialog box so a user can set new criteria. Export Records exports all the records currently being browsed. If you want to limit the set of records you're exporting, use a find request before using Export Records.
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.
Notes
 •
When using the Export Records script step or Import 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 must use the format used by the operating system for the full path. For example, the following are valid paths:
Windows: driveletter:/directoryName/fileName
Mac OS: /Volumes/VolumeName/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.
 •
In FileMaker Go, exporting to .fmp12, XML, and Excel .xls formats is not supported.
Examples 
Go to Layout ["Layout #4"]
Export Records [No dialog, "Contacts"]
Related topics 
Import Records script step
Script steps reference (alphabetical list)
Script steps reference (category list)