2

I have a model that makes a join, adds two fields, and calculates the fields, then uses Feature Class to Feature Class to create a new output. The new output is named "Permit." Once the output is created the fields are labeled "Permit_" + the field name (from source data). I want to exclude the layer name ("Permits_") from the fields, and only keep the field name from the source data. Any thoughts on how to do this? (I have to use Modelbuilder.)

I've traced back where the "Permit_" has been added to my field names. Prior to creating the join, I have a Make Feature Layer, called "Permits Layer". After this there is the join, the fields are then called "Permit.FieldName", this is carried to the final output.

Image of Make Feature Layer joined to source data:

enter image description here

Image of my final output:

enter image description here

Image of entire model:

enter image description here

3
  • There are about 20 fields, and this has to be repeated monthly, so automated would be ideal.
    – a1234
    Mar 31, 2015 at 14:01
  • If you can show your model in your post, it might be helpful. It sounds like probably what is happening is that when you make the join, the fields are taking on the name of the joined fields. There might be a way around this, but it would have to do with the order of steps/tools in the model.
    – GeoJohn
    Mar 31, 2015 at 14:42
  • Quite cumbersome, but at least an option, You could automate the addition of two new fields after the last step, calculate based on the fields with "Permit" in their names and then delete the unwanted fields.
    – GeoJohn
    Mar 31, 2015 at 14:44

2 Answers 2

2

Think you have to modify the model environment variable for fields not to use qualified field names...I don't remember doing that in a model but in principle it is the equivalent of turning 'off' (setting to false) with arcpy.env.qualifiedFieldNames = False, see this:

http://desktop.arcgis.com/en/desktop/latest/tools/environments/qualified-field-names.htm

Otherwise, you can incorporate a small script tool to run ParseFieldName on each of your fields (again, this is arcpy) and 'extract' the unqualified name, but this seems like overkill and needlessly complicates your model.

1

If you look at the help file for any tool, there is a section called Environments and this lists the environment settings that particular tool honours. Add Join honours "Qualified Field Names". So if you un-tick this then the table name should be dropped from the field name. I know that the Copy Features tool also honours this setting.

You should get into the habit of looking at this section of the help file as it can often explain why something does or does not happen.

1
  • @Hornybydd I had that environments for fields set thorough out the model and it is not honoring my settings for some reason (at least for this particular model). For a quick and dirty work around I just added a Make Feature Layer, altered the field names here, then add a Feature Class to Feature Class at the end of the model. Thanks for your help, much appreciated!
    – a1234
    Apr 1, 2015 at 15:08

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.