<?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: Using SummarizeWithin In Geoprocessing Service in Geoprocessing Questions</title>
    <link>https://community.esri.com/t5/geoprocessing-questions/using-summarizewithin-in-geoprocessing-service/m-p/1590984#M27527</link>
    <description>&lt;P&gt;That's&amp;nbsp; very interesting.&amp;nbsp; Seems like a serialisation quirk.&amp;nbsp;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Fri, 28 Feb 2025 22:51:49 GMT</pubDate>
    <dc:creator>DavidPike</dc:creator>
    <dc:date>2025-02-28T22:51:49Z</dc:date>
    <item>
      <title>Using SummarizeWithin In Geoprocessing Service</title>
      <link>https://community.esri.com/t5/geoprocessing-questions/using-summarizewithin-in-geoprocessing-service/m-p/1590981#M27526</link>
      <description>&lt;P&gt;Hey Geoprocessors!&lt;/P&gt;&lt;P&gt;Something interesting I just ran into that I thought I would share. I don't know how many tools this extends to, or how many of you may already know this, or who of you might know other ways around it, but I'm sharing nonetheless.&lt;/P&gt;&lt;P&gt;I have a simple GP tool, published as a web tool to Enterprise 10.9.1 that takes a user-defined point, generates a buffer, and uses SummarizeWithin() to calculate field stats from a hosted feature layer. The first version I built used a hard-coded value table for the &lt;EM&gt;sum_fields&lt;/EM&gt; parameter, i.e.&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="python"&gt;[['abovepoverty','mean']]&lt;/LI-CODE&gt;&lt;P&gt;This worked fine when consuming in a web app. The second version of the tool actually took the multi-value choices from another tool parameter, split them, built the value table, and assigned it to a variable, which was then used as the argument to &lt;EM&gt;sum_fields, i.e.&lt;/EM&gt;&lt;/P&gt;&lt;LI-CODE lang="python"&gt;stats_to_calc = [[field, 'sum'] for field in summary_fields.split(';')]
SummarizeWithin(
    ...,
    sum_fields=stats_to_calc
)&lt;/LI-CODE&gt;&lt;P&gt;After publishing this second version, the tool always failed, with&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;ERROR 100014: Summarize Within failed. Failed to execute (SummarizeWithin).&lt;/LI-CODE&gt;&lt;P&gt;According to an &lt;A href="https://support.esri.com/en-us/knowledge-base/error-100014-summarize-within-failed-000027089" target="_self"&gt;Esri support doc&lt;/A&gt;, this has to do with one of:&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;Feature Class name length&lt;/LI&gt;&lt;LI&gt;Filepath length&lt;/LI&gt;&lt;LI&gt;Field names incorrect/too long&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;None of these made sense to me. Finally, I decided to try one more code alteration, so now the calculation of the value table for the &lt;EM&gt;sum_field&lt;/EM&gt; parameter happened inside the SummarizeWithin() function call, i.e.&lt;/P&gt;&lt;LI-CODE lang="python"&gt;SummarizeWithin(
    ...,
    sum_fields=[[field, 'sum'] for field in summary_fields.split(';')]
)&lt;/LI-CODE&gt;&lt;P&gt;When I published the tool with this alteration, the tool successfully generates my output buffer and summary table. I am not sure why it only likes this methodology, but that's what I've found.&lt;/P&gt;&lt;P&gt;Anyone insight is of course appreciated &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;&lt;P&gt;- Jack C&lt;/P&gt;</description>
      <pubDate>Fri, 28 Feb 2025 22:40:23 GMT</pubDate>
      <guid>https://community.esri.com/t5/geoprocessing-questions/using-summarizewithin-in-geoprocessing-service/m-p/1590981#M27526</guid>
      <dc:creator>__JackCharde__</dc:creator>
      <dc:date>2025-02-28T22:40:23Z</dc:date>
    </item>
    <item>
      <title>Re: Using SummarizeWithin In Geoprocessing Service</title>
      <link>https://community.esri.com/t5/geoprocessing-questions/using-summarizewithin-in-geoprocessing-service/m-p/1590984#M27527</link>
      <description>&lt;P&gt;That's&amp;nbsp; very interesting.&amp;nbsp; Seems like a serialisation quirk.&amp;nbsp;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 28 Feb 2025 22:51:49 GMT</pubDate>
      <guid>https://community.esri.com/t5/geoprocessing-questions/using-summarizewithin-in-geoprocessing-service/m-p/1590984#M27527</guid>
      <dc:creator>DavidPike</dc:creator>
      <dc:date>2025-02-28T22:51:49Z</dc:date>
    </item>
  </channel>
</rss>

