Drawing categories using unique values using ArcMap shows error that ApplySymbologyFromLayer_management can accept only two arguments?

2018-03-21 10:54:16

I have a layer file and I need to apply unique value categories to that layer based on the field present in attribute table of that layer

I tried using:

input = arcpy.GetParameterAsText(0)

output = arcpy.GetParameterAsText(1)

symbologyFields = {"VALUE_FIELD", "#", "symbol"}

arcpy.ApplySymbologyFromLayer_management (input, output,symbologyFields)

But this code shows an error that ApplySymbologyFromLayer_management can accept only two arguments. But I took this code from ArcGIS tool reference site http://pro.arcgis.com/en/pro-app/tool-reference/data-management/apply-symbology-from-layer.htm

What actually I need is to color my polygons using the values in the attribute table field.

i.e.

I can say that apply symbology by going into properties tab and click on categories and the unique values and select the field. This I am in need of doing it with the help of code.

Can anyone help regarding this?

The documentation for Apply Symbology From Layer with ArcGIS Pro

  • The documentation for Apply Symbology From Layer with ArcGIS Pro shows this syntax (four parameters):

    ApplySymbologyFromLayer_management (in_layer, in_symbology_layer, {symbology_fields}, {update_symbology})

    while the documentation for Apply Symbology From Layer with ArcMap shows this syntax (two parameters):

    ApplySymbologyFromLayer_management (in_layer, in_symbology_layer)

    You are working with ArcMap but referring to the documentation from ArcGIS Pro.

    2018-03-21 12:16:35