I'm trying to populate the 'Description' field in the Recycling Locations View layer (a hosted Feature Layer) with the text from the 'Description' field in the Green Descriptions layer (a hosted Table). The 'Category' field from both have the same values.


The script I have uses the UpdateCursor to populate a field based on another field from the same Feature Layer. I think I can create a list with the text from the 'Description' field, but that seems redundant seeing as though there is probably a way to bring it in straight from the hosted table?
<SPAN class="keyword token">import</SPAN> arcpy<SPAN class="punctuation token">,</SPAN> requests<SPAN class="punctuation token">,</SPAN> json
<SPAN class="comment token">#disable warnings</SPAN>
requests<SPAN class="punctuation token">.</SPAN>packages<SPAN class="punctuation token">.</SPAN>urllib3<SPAN class="punctuation token">.</SPAN>disable_warnings<SPAN class="punctuation token">(</SPAN><SPAN class="punctuation token">)</SPAN>
<SPAN class="comment token">#Recycling Locations Feature layer</SPAN>
fc <SPAN class="operator token">=</SPAN> survey_item
<SPAN class="comment token">#text to populate the Description field of the Recycling Locations layer</SPAN>
descriptions <SPAN class="operator token">=</SPAN> <SPAN class="punctuation token">[</SPAN>'Refrigerators<SPAN class="punctuation token">,</SPAN> stoves<SPAN class="punctuation token">,</SPAN> dishwashers<SPAN class="punctuation token">,</SPAN> water heaters <SPAN class="operator token">and</SPAN> other large appliances are considered white goods <SPAN class="operator token">and</SPAN> are banned <SPAN class="keyword token">from</SPAN> landfills<SPAN class="punctuation token">.</SPAN> Hazardous components such <SPAN class="keyword token">as</SPAN> mercury<SPAN class="punctuation token">,</SPAN> CFCs <SPAN class="operator token">and</SPAN> PCBs are dangerous <SPAN class="operator token">and</SPAN> require proper handling <SPAN class="operator token">and</SPAN> disposal<SPAN class="punctuation token">.</SPAN> When purchasing an appliance<SPAN class="punctuation token">,</SPAN> request the company to take your “old” appliance <SPAN class="operator token">or</SPAN> contact your city<SPAN class="operator token">/</SPAN>village<SPAN class="punctuation token">.</SPAN> A list of certified Freon removal specialists <SPAN class="keyword token">is</SPAN> <SPAN class="operator token">not</SPAN> currently available<SPAN class="punctuation token">.</SPAN> The U<SPAN class="punctuation token">.</SPAN>S<SPAN class="punctuation token">.</SPAN> EPA administers a program to certify technicans<SPAN class="punctuation token">.</SPAN> Their requirements can be found at http<SPAN class="punctuation token">:</SPAN><SPAN class="operator token">//</SPAN>www<SPAN class="punctuation token">.</SPAN>epa<SPAN class="punctuation token">.</SPAN>gov<SPAN class="operator token">/</SPAN>Ozone<SPAN class="operator token">/</SPAN>title6<SPAN class="operator token">/</SPAN><SPAN class="number token">608</SPAN><SPAN class="operator token">/</SPAN>608fact<SPAN class="punctuation token">.</SPAN>html<SPAN class="comment token">#techcert',</SPAN>
<SPAN class="string token">'ASBESTOS - Asbestos is a naturally occurring mineral found in certain rocks. Asbestos was commonly used in home building materials before the mid-1970s and occasionally until the late 1980s because it is strong, fire- and corrosion-resistant and a good insulator. If asbestos is in good condition and left in place, it should not present health risks. However, if a building is going to be demolished, renovated, or remodeled, care should be taken to prevent the release of asbestos fibers into the air. Inhalation of microscopic asbestos fibers can cause health risks. You may search for Licensed Asbestos Professionals in the Yellow Pages or call the Illinois Dept. of Public Health.'</SPAN><SPAN class="punctuation token">,</SPAN>
<SPAN class="string token">'In most cases older vehicles are traded-in or brought to an auto salvage yard; or you may choose to donate them for parts reuse and recycling. Contact the following organizations to make arrangements, get paid or ask about tax deduction information.'</SPAN><SPAN class="punctuation token">,</SPAN>
<SPAN class="punctuation token">.</SPAN><SPAN class="punctuation token">.</SPAN><SPAN class="punctuation token">.</SPAN> etc<SPAN class="punctuation token">.</SPAN>
<SPAN class="punctuation token">]</SPAN>
<SPAN class="comment token">#fields from the Recycling Locations layer</SPAN>
fields <SPAN class="operator token">=</SPAN> <SPAN class="punctuation token">[</SPAN><SPAN class="string token">'Description'</SPAN><SPAN class="punctuation token">,</SPAN> <SPAN class="string token">'Category'</SPAN><SPAN class="punctuation token">]</SPAN>
<SPAN class="comment token">#use the updatecursor to populate the Description field from the descriptions list</SPAN>
<SPAN class="keyword token">with</SPAN> arcpy<SPAN class="punctuation token">.</SPAN>da<SPAN class="punctuation token">.</SPAN>UpdateCursor<SPAN class="punctuation token">(</SPAN>fc<SPAN class="punctuation token">,</SPAN> fields<SPAN class="punctuation token">)</SPAN> <SPAN class="keyword token">as</SPAN> cursor<SPAN class="punctuation token">:</SPAN>
<SPAN class="keyword token">for</SPAN> row <SPAN class="keyword token">in</SPAN> cursor<SPAN class="punctuation token">:</SPAN>
<SPAN class="keyword token">if</SPAN> row<SPAN class="punctuation token">[</SPAN><SPAN class="number token">1</SPAN><SPAN class="punctuation token">]</SPAN> <SPAN class="operator token">==</SPAN> <SPAN class="string token">'Appliance Recycling'</SPAN><SPAN class="punctuation token">:</SPAN>
row<SPAN class="punctuation token">[</SPAN><SPAN class="number token">0</SPAN><SPAN class="punctuation token">]</SPAN> <SPAN class="operator token">=</SPAN> descriptions<SPAN class="punctuation token">[</SPAN><SPAN class="number token">0</SPAN><SPAN class="punctuation token">]</SPAN>
<SPAN class="keyword token">elif</SPAN> row<SPAN class="punctuation token">[</SPAN><SPAN class="number token">1</SPAN><SPAN class="punctuation token">]</SPAN> <SPAN class="operator token">==</SPAN> <SPAN class="string token">'Asbestos Info / Removal Service'</SPAN><SPAN class="punctuation token">:</SPAN>
row<SPAN class="punctuation token">[</SPAN><SPAN class="number token">0</SPAN><SPAN class="punctuation token">]</SPAN> <SPAN class="operator token">=</SPAN> descriptions<SPAN class="punctuation token">[</SPAN><SPAN class="number token">1</SPAN><SPAN class="punctuation token">]</SPAN>
<SPAN class="keyword token">elif</SPAN> row<SPAN class="punctuation token">[</SPAN><SPAN class="number token">1</SPAN><SPAN class="punctuation token">]</SPAN> <SPAN class="operator token">==</SPAN> <SPAN class="string token">'Automobile & Boat Reuse Recycling'</SPAN><SPAN class="punctuation token">:</SPAN>
row<SPAN class="punctuation token">[</SPAN><SPAN class="number token">0</SPAN><SPAN class="punctuation token">]</SPAN> <SPAN class="operator token">=</SPAN> descriptions<SPAN class="punctuation token">[</SPAN><SPAN class="number token">2</SPAN><SPAN class="punctuation token">]</SPAN>
cursor<SPAN class="punctuation token">.</SPAN>updateRow<SPAN class="punctuation token">(</SPAN>row<SPAN class="punctuation token">)</SPAN>
<SPAN class="keyword token">del</SPAN> cursor<SPAN class="line-numbers-rows"><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN></SPAN>