<?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 Survey123 report generation fails using ArcGIS API for python in ArcGIS API for Python Questions</title>
    <link>https://community.esri.com/t5/arcgis-api-for-python-questions/survey123-report-generation-fails-using-arcgis-api/m-p/1353593#M9329</link>
    <description>&lt;P&gt;Using the command below&lt;/P&gt;&lt;LI-CODE lang="python"&gt;survey_by_id.generate_report(report_template=choice, report_title="Report",where=f"objectid = {ob}", output_format="pdf")&lt;/LI-CODE&gt;&lt;P&gt;I was able to generate survey123 report using ArcGIS Pro 3.0 when switched to ArcGIS Pro 3.1.3 the code fails and return the following error&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="c"&gt;File "D:\Inspection_report\survey_report.py", line 33, in rep_gen
survey_by_id.generate_report(report_template=choice, report_title="Report",where=f"objectid = {ob}", output_format="pdf")
File "C:\Users\MFarhat\AppData\Local\ESRI\conda\envs\arcgispro-py3-clone\lib\site-packages\arcgis\apps\survey123\_survey.py", line 353, in generate_report
fl_url = self._stk_url
AttributeError: 'Survey' object has no attribute '_stk_url'&lt;/LI-CODE&gt;&lt;P&gt;any idea on how to solve the issue?&lt;/P&gt;</description>
    <pubDate>Mon, 27 Nov 2023 16:59:21 GMT</pubDate>
    <dc:creator>Aymen_Farhat</dc:creator>
    <dc:date>2023-11-27T16:59:21Z</dc:date>
    <item>
      <title>Survey123 report generation fails using ArcGIS API for python</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/survey123-report-generation-fails-using-arcgis-api/m-p/1353593#M9329</link>
      <description>&lt;P&gt;Using the command below&lt;/P&gt;&lt;LI-CODE lang="python"&gt;survey_by_id.generate_report(report_template=choice, report_title="Report",where=f"objectid = {ob}", output_format="pdf")&lt;/LI-CODE&gt;&lt;P&gt;I was able to generate survey123 report using ArcGIS Pro 3.0 when switched to ArcGIS Pro 3.1.3 the code fails and return the following error&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="c"&gt;File "D:\Inspection_report\survey_report.py", line 33, in rep_gen
survey_by_id.generate_report(report_template=choice, report_title="Report",where=f"objectid = {ob}", output_format="pdf")
File "C:\Users\MFarhat\AppData\Local\ESRI\conda\envs\arcgispro-py3-clone\lib\site-packages\arcgis\apps\survey123\_survey.py", line 353, in generate_report
fl_url = self._stk_url
AttributeError: 'Survey' object has no attribute '_stk_url'&lt;/LI-CODE&gt;&lt;P&gt;any idea on how to solve the issue?&lt;/P&gt;</description>
      <pubDate>Mon, 27 Nov 2023 16:59:21 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/survey123-report-generation-fails-using-arcgis-api/m-p/1353593#M9329</guid>
      <dc:creator>Aymen_Farhat</dc:creator>
      <dc:date>2023-11-27T16:59:21Z</dc:date>
    </item>
    <item>
      <title>Re: Survey123 report generation fails using ArcGIS API for python</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/survey123-report-generation-fails-using-arcgis-api/m-p/1414519#M9929</link>
      <description>&lt;P&gt;Did you ever find a solution to this?&lt;/P&gt;</description>
      <pubDate>Wed, 24 Apr 2024 03:08:23 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/survey123-report-generation-fails-using-arcgis-api/m-p/1414519#M9929</guid>
      <dc:creator>JimmyMillar_npdc</dc:creator>
      <dc:date>2024-04-24T03:08:23Z</dc:date>
    </item>
    <item>
      <title>Re: Survey123 report generation fails using ArcGIS API for python</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/survey123-report-generation-fails-using-arcgis-api/m-p/1553371#M10810</link>
      <description>&lt;P&gt;I'm also facing this issue and haven't figured it out yet.&amp;nbsp;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/251557"&gt;@ZacharySutherby&lt;/a&gt;&amp;nbsp;any advice?&lt;/P&gt;</description>
      <pubDate>Tue, 29 Oct 2024 16:27:41 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/survey123-report-generation-fails-using-arcgis-api/m-p/1553371#M10810</guid>
      <dc:creator>MattLayman</dc:creator>
      <dc:date>2024-10-29T16:27:41Z</dc:date>
    </item>
    <item>
      <title>Re: Survey123 report generation fails using ArcGIS API for python</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/survey123-report-generation-fails-using-arcgis-api/m-p/1554719#M10838</link>
      <description>&lt;P&gt;Did you find any solutions&amp;nbsp;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/73572"&gt;@MattLayman&lt;/a&gt;&amp;nbsp;or&amp;nbsp;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/600264"&gt;@Aymen_Farhat&lt;/a&gt;&amp;nbsp;? Any insights would be much appreciated. I'm running into the same issue.&lt;/P&gt;</description>
      <pubDate>Fri, 01 Nov 2024 15:15:52 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/survey123-report-generation-fails-using-arcgis-api/m-p/1554719#M10838</guid>
      <dc:creator>To</dc:creator>
      <dc:date>2024-11-01T15:15:52Z</dc:date>
    </item>
    <item>
      <title>Re: Survey123 report generation fails using ArcGIS API for python</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/survey123-report-generation-fails-using-arcgis-api/m-p/1554721#M10839</link>
      <description>&lt;P&gt;Not yet. I went ahead and added a separate thread to Geonet in the hopes that someone from ESRI will respond...&lt;/P&gt;</description>
      <pubDate>Fri, 01 Nov 2024 15:22:23 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/survey123-report-generation-fails-using-arcgis-api/m-p/1554721#M10839</guid>
      <dc:creator>MattLayman</dc:creator>
      <dc:date>2024-11-01T15:22:23Z</dc:date>
    </item>
    <item>
      <title>Re: Survey123 report generation fails using ArcGIS API for python</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/survey123-report-generation-fails-using-arcgis-api/m-p/1561582#M10905</link>
      <description>&lt;P&gt;Hey guys,&lt;/P&gt;&lt;P&gt;I think we found an answer to this.&amp;nbsp; If you dive into the underlying arcgis api code, it gets into this buggy pathway when the user you are signed in with in the python code is different than the user who owns the item in AGOL.&amp;nbsp; If you make those users one and the same it will run fine.&amp;nbsp; Here is what my code looked like... very simplified for this form.&amp;nbsp; Hope this helps.&amp;nbsp;&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;TLDR:&lt;BR /&gt;&lt;STRONG&gt;Make sure the owner of the form is the same user that you sign into with your python code&lt;/STRONG&gt;&lt;/P&gt;&lt;DIV&gt;&lt;PRE&gt;&lt;SPAN&gt;from &lt;/SPAN&gt;arcgis.gis &lt;SPAN&gt;import &lt;/SPAN&gt;GIS, Item&lt;BR /&gt;&lt;SPAN&gt;from &lt;/SPAN&gt;arcgis.apps.survey123 &lt;SPAN&gt;import &lt;/SPAN&gt;Survey, SurveyManager&lt;BR /&gt;&lt;BR /&gt;gis = GIS(&lt;SPAN&gt;"your_url"&lt;/SPAN&gt;, &lt;SPAN&gt;"your_username"&lt;/SPAN&gt;, &lt;SPAN&gt;"your_password"&lt;/SPAN&gt;)&lt;BR /&gt;&lt;BR /&gt;survey_manager = SurveyManager(gis)&lt;BR /&gt;item = gis.content.get(&lt;SPAN&gt;"your_item_number"&lt;/SPAN&gt;)&lt;BR /&gt;&lt;BR /&gt;survey = Survey(&lt;SPAN&gt;item&lt;/SPAN&gt;=item, &lt;SPAN&gt;sm&lt;/SPAN&gt;=survey_manager)&lt;BR /&gt;&lt;BR /&gt;templates = survey.report_templates&lt;BR /&gt;pdf_report = survey.generate_report(templates[&lt;SPAN&gt;0&lt;/SPAN&gt;], &lt;SPAN&gt;where&lt;/SPAN&gt;=&lt;SPAN&gt;"objectid=1"&lt;/SPAN&gt;, &lt;SPAN&gt;output_format&lt;/SPAN&gt;=&lt;SPAN&gt;"pdf"&lt;/SPAN&gt;)&lt;BR /&gt;&lt;SPAN&gt;print&lt;/SPAN&gt;(&lt;SPAN&gt;"Single report as PDF: "&lt;/SPAN&gt;, pdf_report)&lt;/PRE&gt;&lt;/DIV&gt;</description>
      <pubDate>Fri, 22 Nov 2024 04:05:46 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/survey123-report-generation-fails-using-arcgis-api/m-p/1561582#M10905</guid>
      <dc:creator>NathanWarmerdam</dc:creator>
      <dc:date>2024-11-22T04:05:46Z</dc:date>
    </item>
    <item>
      <title>Re: Survey123 report generation fails using ArcGIS API for python</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/survey123-report-generation-fails-using-arcgis-api/m-p/1565123#M10937</link>
      <description>&lt;P&gt;Thanks Nathan. Yes, I've found this to be the case, however, I want a user who is NOT the owner of the form to be able to run this script. No luck so far with getting ESRI to respond as to whether this is possible...&lt;/P&gt;</description>
      <pubDate>Thu, 05 Dec 2024 14:09:47 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/survey123-report-generation-fails-using-arcgis-api/m-p/1565123#M10937</guid>
      <dc:creator>MattLayman</dc:creator>
      <dc:date>2024-12-05T14:09:47Z</dc:date>
    </item>
  </channel>
</rss>

