Jump to content

Import Define Dialog


This topic is 7546 days old. Please don't post here. Open a new topic instead.

Recommended Posts

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

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

This topic is 7546 days old. Please don't post here. Open a new topic instead.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

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