Jump to content
View in the app

A better way to browse. Learn more.

FMForums.com

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Import Mapping Question

Featured Replies

Once again, cerebral density has raised its ugly head (that's why I don't post a picture of myself);)

I have a runtime that I want to be able to import records with from the desktop. The problem is, the runtime doesn't "know" how to map the Source fields to the Target fields for import in the Import Field Mapping windoid. (The Source side is blank.) How do I code the Import Records script step so it'll pre-match the field names ("arrange by: matching names")so the import can take place?

TIA for your help,

Rich

First you need a file which is just like the one you're going to import, choose its type of file in the dialog (dropdown). Then create a script with an Import Records step, and you can match fields to your file. If you run this script it should default to that order, even if you target another file of that type (not sure how reliably).

You will need the original file, or one named and structured like it, if you later want to adjust the Import order.

But the best way is if you can pass the file path to FileMaker (either relative or absolute) to set into a script $variable. FileMaker can calculate the Desktop path (if the file is directly on the desktop). It's a little difficult however to get that file path/name first using just a FileMaker dialog (because you don't know the name of the file, unless you always have the same name, in which case it should just work).

There is at least one free plug-in which can do this, MooPlug. I believe it returns a Windows OS syntax file path, so you'd need to coerce that to a FileMaker syntax path (easy).

You then set the FileMaker syntax path into a script variable;

Set Variable [ $path; "the FileMaker syntax path" ]

Then use that script variable as the 1st line in the "path" dialog of the Import Records step:

$path (no quotes)

path to original file (which ain't there most of the time)

This tells FileMaker to look first at the path specified by the $path variable. If it is not there, then look for the original file's path. This should work reliably in a scripted Import of a "same-structured" file.

If you want to reset the Import order, you just put the original file (or one like it) in the place it is expected. Then the source fields will be there, and you adjust. Then save the script's changes.

  • Author

Hi, Fenton:

Yup, I'm using a good path to get to the desktop:

Case (Abs ( Get ( SystemPlatform )) = 1; "filemac:"; "filewin:") & Get ( DesktopPath ) & "CL Job.fp7"

I think I answered my own question: While in the Import Mapping windoid I set it to look for the same fieldnames and clicked the appropriate arrows to the fields I wanted to import--it works.

Where I'm running into trouble now is trying to import fields generated in two separate tables in the export files. Good thing I have a bottle of Tylenol handy. ;)

Two tables is just 2 Import Records steps. If the path is good, you can choose a different Source table, and a Target table. I usually go to the Target layout first. Since this is scripted, with no dialog, you cannot even see that it's doing 2, unless you watch the import progress bar start over again.

Create an account or sign in to comment

Important Information

By using this site, you agree to our Terms of Use.

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.