You are here: Field Rules Reference > Field Rules Summary > MapFromImportData

MapFromImportData

Use this field level rule to map imported data from an internal dictionary to a field, as opposed to mapping from an extract file. Normally, you use this rule with either the ImportFile or ImportExtract rules, however, you can use this rule with any preceding rule that fills in field dictionary values.

By default, this rule checks for a dictionary value starting with the section dictionary, then the form dictionary, and finally the form set (global) dictionary. The search ends as soon as the rule finds a value for the field.

If no dictionary entry is found for the field, the field remains blank. Use the Required flags in the rule definition to control whether an empty field is considered an error.

Note For some legacy implementations, this rule was registered under the name NoOpImp.

If you do not use this rule, you must use the ReplaceNoOpFunc rule and make sure that all of the fields for each file are set to NoOpFunc.

Syntax

MapFromImportData ( )

You can use the optional INDEX parameter to specify a particular dictionary instance of the field to use. This is only useful if you use the ImportFile or ImportExtract rules to import form set data.

For the ImportFile rule, to support field instances you must include this INI option:

< ImportFile >

IndexDuplicateFields = Yes

For the ImportExtract rule, to support field instances you must include this INI option:

< ImportExtract >

IndexDuplicateFields = Yes

Normally, duplicate field entries found in the import file are ignored. If, however, you enter Yes, each instance is stored in a separate dictionary entry.

Note Field instance (indexing) only applies to field data stored in the form set (global) dictionary.

The parameter value to specify indexing has this syntax:

INDEX(option,...)

Where option is a keyword that indicates how to calculate the dictionary instance to use or a constant value to use as the index.

Here is a list of the keywords you can use:

Keyword

Description

FORM

Use the occurrence of this form as the instance index. For example, if this field is contained on the second copy of this form, then get the second instance of field data.

IMG

Use the occurrence of this section within the current form as the instance index. For example, if this field is contained on the third copy of section on the current form, then get the third instance of field data.

IMGFSET

Use the occurrence of this section within the entire form set as the instance index. For example, if this is the fifth occurrence of this section within the form set (without considering what forms contain the other copies of this section), then get the fifth instance of field data.

FLD

Use the occurrence of this field within the current form as the instance index. For example, if this field is the third occurrence within the same form, then get the third instance of field data.

FLDFSET

Use the occurrence of this field within the entire form set as the instance index. For example, if this is the tenth occurrence of this field within the entire form set (without considering what forms and sections contain the other copies of this field), then get the tenth instance of field data.

A successful return does not indicate whether the field was assigned a value.

See also