Using a Script to Import Data

 <  Day Day Up  >  

Like most other actions in FileMaker Pro, importing data can be triggered from a script. It's possible to save your import settings in a script for later reuse as well.

A scripted import has a few steps and options that are slightly different from the regular File, Import Records method. To import records from within a script, choose the Import Records script step and add it to your script. ScriptMaker gives you several choices, as shown in Figure 19.23.

Figure 19.23. FileMaker enables you to save a number of options when you import records from within a script.
graphics/19fig23.jpg

The Specify Data Source menu at the lower right gives you access to a set of options identical to those you see when you choose File, Import Records. Using this selection, you can save all the important information about your data source. For files, this means mainly the file name . For folders, it includes the file type, and the choice of whether to save references or not. For ODBC data sources, it includes the DSN information, password, and other data such as a SQL query.

The Specify Import Order button at the lower right gives you access to the Import Field Mapping dialog, where you can set any or all of the relevant import mapping features.

Finally, as with other script steps in FileMaker, you have the choice of performing the import with or without dialogs. If you choose to run the import with dialogs, the user can re-specify any aspect of the data source or import order on the fly. If you choose to run it without dialogs, the import is a "canned" process that uses all the saved options you've specified.

TIP

When performing a complex import, you may want to save "drafts" of the import into a script as you go. That way if you make a mistake or need to change things, you don't run the risk of FileMaker " forgetting " the import specification you worked so hard on.


 <  Day Day Up  >  


QUE CORPORATION - Using Filemaker pro X
QUE CORPORATION - Using Filemaker pro X
ISBN: N/A
EAN: N/A
Year: 2003
Pages: 494

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net