Rename
The Rename tool adds a prefix or suffix to the name of every field in the record, or removes one. You can use Rename when joining two tables in order to avoid duplicate field names in the "wide" record of the Join tool output. It also helps identify the source of each field in the "wide" record. This technique is especially useful if you want to join two tables together, perform some calculations between the fields of the "wide" record, and then split the record apart again into separate tables.
Renaming fields in this manner lets you address the fields from the Left and Right inputs much as you would the columns of an SQL query involving multiple tables. Once you have made assignments between the fields of the "wide" record, you split the fields of the Left and Right tables using the Select tool, and then remove the Right field prefixes to restore the Right record schema to its original form.
You can rename individual fields using the Select tool.
Rename tool configuration parameters
The Rename tool has a single set of configuration parameters in addition to the standard execution options
Action | Specify whether to add or remove characters from the input field names, or alter them using a user-defined expression. This is optional and defaults to Add. |
Position | Specify the field-name component to add or remove. This is optional and defaults to Prefix. |
Value | Specify the prefix or suffix to add or remove. |
Expression | If Action is Expression, the expression to be evaluated (using FIELDNAME for the existing field name) to generate the new field name. |
Configure the Rename tool
Select the Rename tool, and then go to the Configuration tab on the Properties pane.
Select Action and select Add, Remove, or Expression.
If you selected Add or Remove in step 2:
Select Position and select either Prefix or Suffix to indicate the field-name component to add or remove.
Select Value and type the field-name component you want to add or remove.
For example, the following configuration:
![](../__attachments/3911122966/att_1_for_3911122966.png?inst-v=c3007bf4-8f91-43d3-9633-90859273c945)
would rename the fields of a typical name/address table as follows:
Old Name | New Name |
---|---|
NAME | NAME_RIGHT |
ADDRESS | ADDRESS_RIGHT |
CITY | CITY_RIGHT |
STATE | STATE_RIGHT |
ZIP | ZIP_RIGHT |
To reverse this operation, you would configure another Rename tool like this:
![](../__attachments/3911122966/att_2_for_3911122966.png?inst-v=c3007bf4-8f91-43d3-9633-90859273c945)
If you selected Expression in step 2, enter an Expression to be evaluated (using FIELDNAME for the existing field name) to generate the new field names. For example, the expression "Customer_" + FIELDNAME + "_output" would generate field names like
Customer_ID_output
andCustomer_Company_output
.Optionally, go to the Execution tab, and then set Web service options.