Select to view content in your preferred language

ApplySymbologyFromLayer Error 000800

1047
4
Jump to solution
03-13-2022 11:30 PM
GloriaDesanker
Occasional Contributor

apply symbology error.PNG

The attached photo and below script shows the line of code that I am getting an error with. I am trying to run arcpy.management.ApplySymbologyFromLayer in arcpy. And am getting an error saying that "the value is not a member of " my shapefile. The name of the column I want to use to symbolize is "FinishedCallStation" for both the layer file and the shapefile. The error message shows that the column exists in my shapefile, so I don't know why I keep getting the 000800 error.

Below are 3 iterations of this line of code I've tried, but am getting the same "value is not a member" error for.

Version 1:

all_stations_visits = arcpy.management.ApplySymbologyFromLayer(in_layer=all_stations_joined, in_symbology_layer=all_stations_symbology_lyrx, symbology_fields=[["VALUE_FIELD", "FinishedCallStation", "FinishedCallStation"]], update_symbology="MAINTAIN")[0]

Version 2:

all_stations_visits = arcpy.management.ApplySymbologyFromLayer(in_layer=all_stations_joined, in_symbology_layer=all_stations_symbology_lyrx, symbology_fields=[["VALUE_FIELD", "FinishedCallStation", "all_stations_joined.FinishedCallStation"]], update_symbology="MAINTAIN")[0]

Version 3:

all_stations_visits = arcpy.management.ApplySymbologyFromLayer(in_layer=all_stations_joined, in_symbology_layer=all_stations_symbology_lyrx, symbology_fields=[["VALUE_FIELD", "all_stations_symbology_lyrx.FinishedCallStation", "all_stations_joined.FinishedCallStation"]], update_symbology="MAINTAIN")[0]

I saw that there was a similar question to this from 2017 but I didn't see a solution marked and the suggestions did not work for me. https://community.esri.com/t5/arcgis-pro-sdk-questions/building-proper-syntax-for-importing-lyr-symb...

Any help and assistance is appreciated!

0 Kudos
1 Solution

Accepted Solutions
GloriaDesanker
Occasional Contributor

I realized that the visibility for the field I was trying to use to symbolize the feature layer. So I had turned the visibility off for all_stations_joined.FinishedCallStation in the ArcPro attribute table and I guess that also impacted arcpy.

View solution in original post

0 Kudos
4 Replies
DanPatterson
MVP Esteemed Contributor

Did you try a simpler variant

... ("all_stations_joined", "all_stations_symbology_lyrx",  [["VALUE_FIELD", "#", "FinishedCallStation"]] ...

And the full paths to the inputs should be defined as variables.


... sort of retired...
0 Kudos
GloriaDesanker
Occasional Contributor

Hi Dan, thanks for the suggestion. I tried simplifying but I'm getting the same error. Also my arguments are being read in as paths, see below:

All_Call_Stations_gdb= path to my gdb

all_stations_joined = All_Call_Stations_gdb + "\\all_stations_joined"

all_stations_symbology_lyrx = "C:\\...\\all_stations_finished_symbology.lyrx"

0 Kudos
DavidPike
MVP Frequent Contributor

Does the input not need to be a layer?

0 Kudos
GloriaDesanker
Occasional Contributor

I realized that the visibility for the field I was trying to use to symbolize the feature layer. So I had turned the visibility off for all_stations_joined.FinishedCallStation in the ArcPro attribute table and I guess that also impacted arcpy.

0 Kudos