<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: survey_by_id.generate_report error CONT_0004: User folder does not exist in ArcGIS API for Python Questions</title>
    <link>https://community.esri.com/t5/arcgis-api-for-python-questions/survey-by-id-generate-report-error-cont-0004-user/m-p/1282937#M8636</link>
    <description>&lt;P&gt;Edit: removing the Folder_ID= parameter automatically puts the output into&amp;nbsp;C:\Users\[UserName]\AppData\Local\Temp\5&lt;/P&gt;&lt;P&gt;Is there any way to specify this directory instead?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Perhaps overcomplicating this --- for the AGO NB it needed to create content in a specific AGO folder for a specific user/account.&amp;nbsp; However, I'm starting to better understand the differences running locally and perhaps there's no need to deal with created the report output and saving to a folderId.&lt;/P&gt;&lt;P&gt;From&amp;nbsp;&lt;A href="https://developers.arcgis.com/python/api-reference/arcgis.apps.survey123.html" target="_blank" rel="noopener"&gt;https://developers.arcgis.com/python/api-reference/arcgis.apps.survey123.html&lt;/A&gt;&amp;nbsp;it mentions,&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;To save to disk, do not specify a folder_id&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;So, removing the folder_id parameter in that generate_report() method it actually worked!&amp;nbsp; However, I'm unsure where it saved the output pdf to?&amp;nbsp; Also, I attempted to add a save_folder parameter but it doesn't recognize that as a valid input.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Wed, 26 Apr 2023 17:33:38 GMT</pubDate>
    <dc:creator>JamesCrandall</dc:creator>
    <dc:date>2023-04-26T17:33:38Z</dc:date>
    <item>
      <title>survey_by_id.generate_report error CONT_0004: User folder does not exist</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/survey-by-id-generate-report-error-cont-0004-user/m-p/1282867#M8635</link>
      <description>&lt;P&gt;ArcPro 2.9.7&lt;/P&gt;&lt;P&gt;Conda 3.7&lt;/P&gt;&lt;P&gt;Error: "&lt;SPAN&gt;Exception:&amp;nbsp;upload&amp;nbsp;destination&amp;nbsp;is&amp;nbsp;invalid.&amp;nbsp;CONT_0004:&amp;nbsp;User&amp;nbsp;folder&amp;nbsp;does&amp;nbsp;not&amp;nbsp;exist."&lt;/SPAN&gt;&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;/DIV&gt;&lt;P&gt;I have a hosted AGO Notebook that works as expected and now I'm attempting to bring this down and re-write locally as a standalone .py script.&amp;nbsp; The local .py script works but fails on this line,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="python"&gt;pdf_report = survey_by_id.generate_report(templates[0], where=whereClause, utc_offset=offset, output_format="pdf", report_title=reportName, merge_files="nextPage", folder_id='e1d58030cf4a40a989beffc9349fa501')&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm getting the AGO folder id by simply navigating to it and copying the &amp;amp;folder= parameter value from the url (so I know it's correct and it also works in the NB when running on AGOL).&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Reason for bringing down local is over the life of the existing NB that runs daily on AGOL, we've seen some hiccups of that implementation -- sometimes it may have been a task scheduler thing or the NB would execute without errors/issues but would not generate the pdf output for some reason or another (but on subsequent manual attempts it would work just fine).&amp;nbsp; The majority of the time it runs without issue but there's no real good way to monitor things and handle problems when they occur -- when you have a high visibility output that the NB generates then this is a problem because it requires constant babysitting.&lt;/P&gt;&lt;P&gt;We have a ton of experience with py 2.7 scripts running on a windows server vm that get run via the task scheduler and having them run locally there's simply more options available to handle execution failures in more hands-off approach.&lt;/P&gt;</description>
      <pubDate>Wed, 26 Apr 2023 17:01:24 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/survey-by-id-generate-report-error-cont-0004-user/m-p/1282867#M8635</guid>
      <dc:creator>JamesCrandall</dc:creator>
      <dc:date>2023-04-26T17:01:24Z</dc:date>
    </item>
    <item>
      <title>Re: survey_by_id.generate_report error CONT_0004: User folder does not exist</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/survey-by-id-generate-report-error-cont-0004-user/m-p/1282937#M8636</link>
      <description>&lt;P&gt;Edit: removing the Folder_ID= parameter automatically puts the output into&amp;nbsp;C:\Users\[UserName]\AppData\Local\Temp\5&lt;/P&gt;&lt;P&gt;Is there any way to specify this directory instead?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Perhaps overcomplicating this --- for the AGO NB it needed to create content in a specific AGO folder for a specific user/account.&amp;nbsp; However, I'm starting to better understand the differences running locally and perhaps there's no need to deal with created the report output and saving to a folderId.&lt;/P&gt;&lt;P&gt;From&amp;nbsp;&lt;A href="https://developers.arcgis.com/python/api-reference/arcgis.apps.survey123.html" target="_blank" rel="noopener"&gt;https://developers.arcgis.com/python/api-reference/arcgis.apps.survey123.html&lt;/A&gt;&amp;nbsp;it mentions,&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;To save to disk, do not specify a folder_id&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;So, removing the folder_id parameter in that generate_report() method it actually worked!&amp;nbsp; However, I'm unsure where it saved the output pdf to?&amp;nbsp; Also, I attempted to add a save_folder parameter but it doesn't recognize that as a valid input.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 26 Apr 2023 17:33:38 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/survey-by-id-generate-report-error-cont-0004-user/m-p/1282937#M8636</guid>
      <dc:creator>JamesCrandall</dc:creator>
      <dc:date>2023-04-26T17:33:38Z</dc:date>
    </item>
    <item>
      <title>Re: survey_by_id.generate_report error CONT_0004: User folder does not exist</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/survey-by-id-generate-report-error-cont-0004-user/m-p/1282970#M8637</link>
      <description>&lt;P&gt;Resolved.&amp;nbsp; Simply removing the Folder_ID parameter from the generate_report() method automatically writes the output to the local directory&amp;nbsp;C:\Users\[username]\AppData\Local\Temp\5&lt;/P&gt;&lt;P&gt;From there I can simply use&amp;nbsp;&lt;SPAN&gt;shutil&lt;/SPAN&gt;&lt;SPAN&gt;.&lt;/SPAN&gt;&lt;SPAN&gt;copyfile() to put it into a desired directory.&lt;/SPAN&gt;&lt;/P&gt;&lt;LI-CODE lang="python"&gt;save_pdf=r'H:\AGOL\bga\bgaReportCopy.pdf'
pdf_report = survey_by_id.generate_report(templates[0], where=whereClause, utc_offset=offset, output_format="pdf", report_title=reportName, merge_files="nextPage")
    
shutil.copyfile(pdf_report,save_pdf)&lt;/LI-CODE&gt;</description>
      <pubDate>Wed, 26 Apr 2023 18:00:08 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/survey-by-id-generate-report-error-cont-0004-user/m-p/1282970#M8637</guid>
      <dc:creator>JamesCrandall</dc:creator>
      <dc:date>2023-04-26T18:00:08Z</dc:date>
    </item>
  </channel>
</rss>

