Importing data in FileMaker Go
To merge data from a local file on an iOS or iPadOS device to a FileMaker Pro file using FileMaker Go, you must use the Import Records script step.
In FileMaker Pro, you create a script that uses the Import Records script step, which specifies the source file to import from and sets up the mapping of source fields to target fields. Your script can:
-
import from a remote FileMaker Pro file into another local or remote FileMaker Pro file
-
import from a local source (FileMaker Pro or other supported formats) into a local or remote FileMaker Pro file
See the following examples and the Import Records script step in FileMaker Pro Help.
Example 1: Importing from a remote source (Remote.fmp12) into a local file (Local.fmp12)
In this example, the Local.fmp12 file is on an iOS or iPadOS device and needs a script that imports data from a remote source (Remote.fmp12). You need to use FileMaker Pro to create the script in the local file, then transfer the file to FileMaker Go. You can then run the script in FileMaker Go to import the data from the remote file.
-
Open Local.fmp12 and Remote.fmp12 in FileMaker Pro.
-
Create a script in Local.fmp12. For example:
CopyImport Records [ With dialog: Off ; Table: Local ; "Remote.fmp12" ; Update ; Mac Roman ]
-
Select Specify data source, then choose File.
-
In the Specify File dialog box, for File Type, select FileMaker Pro Files. Then set up a path to the remote source file using the host's domain name or IP address. For example:
fmnet:/myhost.example.com/Remote.fmp12
-
Select Specify import order and choose which source fields to map to target fields.
-
Save the script.
-
Close Local.fmp12.
-
Transfer Local.fmp12 to FileMaker Go.
-
Open Local.fmp12 in FileMaker Go, and run the script.
The local file is updated with data from the remote file.
Example 2: Importing from a local source (Local.csv) into a remote file (Remote.fmp12)
In this example, the remote file (Remote.fmp12) needs a script that imports data from a local comma-separated values file (Local.csv). You need to use FileMaker Pro to create the script in the remote file, then use FileMaker Go to open the hosted remote file on your iOS or iPadOS device and run the script to import the data from the local file.
-
Transfer Local.csv to FileMaker Go.
-
Open Remote.fmp12 in FileMaker Pro.
-
Use the Script Workspace to create a script in Remote.fmp12. For example:
CopySet Variable [ $FilePath ; Value: Get(DocumentsPath) & "Local.csv" ]
Import Records [ With dialog: Off ; Table: Local ; "$FilePath" ; Add ; Mac Roman ]where the path to the source file on the device is
file:$FilePath
-
For the Import Records script step, select Specify data source, then choose File.
-
In the Specify File dialog box, for File Type, select Comma-Separated Values. Then add another path to the path list where FileMaker Pro can find a local copy of Local.csv. For example:
file:$FilePath
file:Local.csv
This second path allows FileMaker Pro to set up the source fields in the Import Records script step.
-
Select Specify import order.
If a record in the source data you're importing contains field names (column headings) instead of data, click < or > until the record containing field names appears. Then choose Use as Field Names. Now you can choose which target fields to import each source field into.
-
Save the script.
-
In FileMaker Go, open the hosted Remote.fmp12 file.
-
Run the script from Remote.fmp12 in FileMaker Go.
The remote file is updated with data from the local file.