Updating field based on location

Discussion created by emilharold on Nov 15, 2013
Latest reply on Nov 20, 2013 by doug.sands
I have the following information:

A table with a list of cities
A cities layer
A grid layer

I am trying to write a code that goes through the list of cities and searches for each grid that intersects each city in the list. So if I have a city of 'somewhereville' python will find all the grids that intersect the 'somewhereville' feature and then updates a field in the grid's attribute with the city name ('somewhereville'). I have tried a few ways but I can't quite figure it out. Any direction would be great.