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 Define Dialog

Featured Replies

Has anyone figured out how to simulate the Define Import Dialog, since it isn't a Scriptmaker option. What I'd like to do is give a user the ability to import CSV or tab-separated values by mapping fields in the input file with the fields in an FM file.

Steve

You can create a set of import fields that the user never sees, and always import into those. Then, let the user select a mapping that transfers the data from these import fields into the regular fields.

For example you might have 20 import fields named ImportField1, ImportField2, ... ImportField20. Your script would always import into these fields. So a script might be:

Import [restore]

SetField[MyRegularField1, GetField("ImportField"&gF1Order)]

SetField[MyRegularField2, GetField("ImportField"&gF2Order)]

SetField[MyRegularField3, GetField("ImportField"&gF3Order)]

...

SetField[MyRegularField20, GetField("ImportField"&gF20Order)]

The globals gF1Order, gF2Order, etc., would be the actual field mapping previously set by the user in some sort of dialog.

  • Author

Okay, but what does the dialog look like. Do I use a portal and move the field order up and down in the portal? Other suggestions?

That's the tricky part. You can't drag field names up and down like in a regular import dialog, but you could implement one of those portal ordering techniques. I think Dj posted an example in the samples forum.

Yes, Dj's renumbering portal rows technique would surely help here. I've been doing something very similar a while back (while not an import procedure) just using this posted technique.

You could even set a default order.

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.