Hello, I am trying to create a definition query for layers in a specific group. The following works to create the definition query in the group but I was wondering if there is a way to name the query rather than it defaulting to Query 1.
aprx = arcpy.mp.ArcGISProject("CURRENT")
# Access the map
map_obj = aprx.listMaps("Map")[0]
# Define the definition query
definition_query = "field = 'value'"
# Apply the definition query to all layers in a specific group
group_layer_name = "Working"
group_layer = map_obj.listLayers(group_layer_name)[0]
for layer in group_layer.listLayers():
if layer.isFeatureLayer:
layer.definitionQuery = definition_queryThanks!