Label | Explanation | Data Type |
Data Reference Workbook
| The Data Reference Workbook that will be used to generate a Mapping Table. | File |
Output Table | The output table, which will include a list of datasets, fields, and attribute domain coded value descriptions based on the source and target mapping from a Data Loading Workspace. Use this table in the Create Data Loading Workspace tool to refine a future iteration of a Data Loading Workspace. | Table |
Summary
Generates the Mapping Table based on a configured data loading workspace. The table includes a list of predefined datasets, fields, and attribute domain coded value descriptions. This output table is used as input to the Create Data Loading Workspace tool.
Usage
The table includes a collection of substrings, delimited by spaces, that are used to match a source to a target schema. The table is used to bidirectionally match substrings, so order is not important.
A field can be excluded from use in all field matching if the type field is set to Field, the match_strings field is set to Exact Block, and only one substring is provided. In this case, the field name specified in the substring will be ignored and will not be used in any matches.
The output table includes the following fields:
- type—The dataset, field, or value.
Coded value Coded value description Description dataset Dataset A match or block will be created between datasets.
field Field A match or block will be created between fields.
value Attribute Domain Coded Value Descriptions A match or block will be created between attribute domain coded value descriptions.
- substringsa—A user-defined substring.
- substringsb—A user-defined substring.
- match_strings—A value that controls how strings are matched or blocked. The field can include the following values:
Coded value Coded value description Description yes Predictive Match Predictive logic will be used to find matches similar to the two substrings.
no Predictive Block Predictive logic will be used to block matches similar to the two substrings.
exact_match Exact Match A match will be made when an exact match is found for the two substrings.
exact_block Exact Block A block will be made when an exact match is found for the two substrings.
Note:
The description of the yes and no coded values in the attribute domain for the match_strings field changed at ArcGIS Pro 3.3. The description of Match has been updated to Predictive Match for the coded value of yes. The description of Block has been updated to Predictive Block for the coded value of no.
- type—The dataset, field, or value.
Parameters
arcpy.management.GenerateMappingTable(in_workbook, out_table)
Name | Explanation | Data Type |
in_workbook | The Data Reference Workbook that will be used to generate a Mapping Table. | File |
out_table | The output table, which will include a list of datasets, fields, and attribute domain coded value descriptions based on the source and target mapping from a Data Loading Workspace. Use this table in the Create Data Loading Workspace tool to refine a future iteration of a Data Loading Workspace. | Table |
Code sample
The following Python window script demonstrates how to use the GenerateMappingTable function in immediate mode.
import arcpy
arcpy.management.GenerateMappingTable(
"C:/data/DataLoadingWorkspace/DataReference.xlsx", "C:/temp/Default.gdb/DataReference_GenerateMappingTable"
)
The following script demonstrates how to use the GenerateMappingTable function in a stand-alone script.
# Name: GenerateMappingTable.py
# Description: Generate a Mapping Table from the input Data Reference workbook.
# Import system modules
import arcpy
# Set local variables
workbook = "C:/data/DataLoadingWorkspace/DataReference.xlsx"
mapping = "C:/temp/MappingTable.csv"
arcpy.management.GenerateMappingTable(in_workbook=workbook, out_table=mapping)