Using a Script to Import Data

Table of contents:

Troubleshooting

Matching imports

I can't get an import to work using the "update matching records" option. The outcome is never what I expect.

When you choose to "update matching records" when importing data into a FileMaker table, FileMaker tries to match records in the source to records in the target, based on the specified match field or match fields. We've been assuming that there will be at most one source record and one target record that share the same match criteria. But what happens if there are multiple matches on either or both sides?

Assume that you're doing a matching import based on a Social Security number. If there are several records in the source data with the same Social Security number, the data from the last of these records is used to update matching records in the target (assuming there are any).

On the other hand, if there are multiple records with the same Social Security number on the target side, they are all updated with whatever turns out to be the matching data from the source side. So all target records with the same value in their match field(s) are updated with the same data from the source, whether that means updating two target records or two thousand.

If you put both scenarios together, and multiple records in both the source and target share the same Social Security number, the outcome is as follows: Data from the last such record in the source will be used to update all the matching records in the target. If four matching records were in the source, and nineteen in the target, data from the fourth matching source record would be used to update all nineteen matching target records.

Imports and Validation

I imported data, but some of it turned out to be invalid. I have field validation rules set up, but it seems as though FileMaker is ignoring them.

In previous versions of FileMaker, field validation and data imports didn't mix well. FileMaker simply didn't perform any field validation at all on data that was imported. Even if you marked a field as having to be not empty, for example, it was perfectly possible to import records that had no value in that field. This could be an annoying back door around your carefully constructed validation rules.

The situation is better in FileMaker 8 (and in FileMaker 7 as well), but there are still pitfalls. Everything depends on your field validation settings. When you apply validation to a field in FileMaker 8, you can choose to validate the data Only During Data Entry, or Always. If you select the first option, the behavior is similar to previous versions of FileMaker: Imported data is not checked for validity, and it's up to you to handle the consequences. On the other hand, if you choose Always for the data validation on a field, imported records are checked. If this is the case, any record that does not pass a validation check is rejected, and the dialog box that appears at the end of the import tells you how many records were rejected (though not which ones, unfortunately).


Part I: Getting Started with FileMaker 8

FileMaker Overview

Using FileMaker Pro

Defining and Working with Fields

Working with Layouts

Part II: Developing Solutions with FileMaker

Relational Database Design

Working with Multiple Tables

Working with Relationships

Getting Started with Calculations

Getting Started with Scripting

Getting Started with Reporting

Part III: Developer Techniques

Developing for Multiuser Deployment

Implementing Security

Advanced Interface Techniques

Advanced Calculation Techniques

Advanced Scripting Techniques

Advanced Portal Techniques

Debugging and Troubleshooting

Converting Systems from Previous Versions of FileMaker Pro

Part IV: Data Integration and Publishing

Importing Data into FileMaker Pro

Exporting Data from FileMaker

Instant Web Publishing

FileMaker and Web Services

Custom Web Publishing

Part V: Deploying a FileMaker Solution

Deploying and Extending FileMaker

FileMaker Server and Server Advanced

FileMaker Mobile

Documenting Your FileMaker Solutions



Using FileMaker 8
Special Edition Using FileMaker 8
ISBN: 0789735121
EAN: 2147483647
Year: 2007
Pages: 296

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