I will preface this post, in saying that I am new to script workflows in Python, and I believe that this process is probably very simple to accomplish but keep getting an error.
All I am trying to do is export/copy a feature service it to a local geodatabase where I can work on it locally.
I have provided the code below. I keep getting an "Object: Error in executing tool" for the last line where I am trying to copy the feature.
<SPAN class="keyword token">from</SPAN> arcgis<SPAN class="punctuation token">.</SPAN>gis <SPAN class="keyword token">import</SPAN> GIS
<SPAN class="keyword token">from</SPAN> arcgis<SPAN class="punctuation token">.</SPAN>features<SPAN class="punctuation token">.</SPAN>use_proximity <SPAN class="keyword token">import</SPAN> create_buffers
<SPAN class="keyword token">import</SPAN> arcpy
<SPAN class="comment token">#########################################################################################</SPAN>
GDB_Name <SPAN class="operator token">=</SPAN> input<SPAN class="punctuation token">(</SPAN><SPAN class="string token">"Name Geodatabase"</SPAN><SPAN class="punctuation token">)</SPAN>
Folder_Input <SPAN class="operator token">=</SPAN> input<SPAN class="punctuation token">(</SPAN><SPAN class="string token">"Provide Folder Path of Project"</SPAN><SPAN class="punctuation token">)</SPAN>
Item_ID <SPAN class="operator token">=</SPAN> input<SPAN class="punctuation token">(</SPAN><SPAN class="string token">"Provide item ID"</SPAN><SPAN class="punctuation token">)</SPAN>
<SPAN class="comment token">#########################################################################################</SPAN>
gis <SPAN class="operator token">=</SPAN> GIS<SPAN class="punctuation token">(</SPAN><SPAN class="string token">"http://arcgis.com"</SPAN><SPAN class="punctuation token">,</SPAN> <SPAN class="string token">"xyz"</SPAN><SPAN class="punctuation token">,</SPAN> <SPAN class="string token">"xyz"</SPAN><SPAN class="punctuation token">)</SPAN>
search_results <SPAN class="operator token">=</SPAN> gis<SPAN class="punctuation token">.</SPAN>content<SPAN class="punctuation token">.</SPAN>search<SPAN class="punctuation token">(</SPAN><SPAN class="string token">'{}'</SPAN><SPAN class="punctuation token">.</SPAN>format<SPAN class="punctuation token">(</SPAN>Item_ID<SPAN class="punctuation token">)</SPAN><SPAN class="punctuation token">)</SPAN>
Trail_Data <SPAN class="operator token">=</SPAN> search_results<SPAN class="punctuation token">[</SPAN><SPAN class="number token">0</SPAN><SPAN class="punctuation token">]</SPAN>
WorkspaceGDB <SPAN class="operator token">=</SPAN> arcpy<SPAN class="punctuation token">.</SPAN>CreateFileGDB_management<SPAN class="punctuation token">(</SPAN>Folder_Input<SPAN class="punctuation token">,</SPAN> <SPAN class="string token">'{}.gdb'</SPAN><SPAN class="punctuation token">.</SPAN>format<SPAN class="punctuation token">(</SPAN>GDB_Name<SPAN class="punctuation token">)</SPAN><SPAN class="punctuation token">)</SPAN>
<SPAN class="keyword token">print</SPAN><SPAN class="punctuation token">(</SPAN><SPAN class="string token">"GDB created"</SPAN><SPAN class="punctuation token">)</SPAN>
arcpy<SPAN class="punctuation token">.</SPAN>env<SPAN class="punctuation token">.</SPAN>workspace <SPAN class="operator token">=</SPAN> r<SPAN class="string token">'{}'</SPAN><SPAN class="punctuation token">.</SPAN>format<SPAN class="punctuation token">(</SPAN>WorkspaceGDB<SPAN class="punctuation token">)</SPAN>
arcpy<SPAN class="punctuation token">.</SPAN>CopyFeatures<SPAN class="punctuation token">(</SPAN>Trail_Data<SPAN class="punctuation token">,</SPAN> <SPAN class="string token">"Area_Trail_Data"</SPAN><SPAN class="punctuation token">)</SPAN><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>