<?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: groupByFieldsForStatistics in REST API URL? in ArcGIS Online Developers Questions</title>
    <link>https://community.esri.com/t5/arcgis-online-developers-questions/groupbyfieldsforstatistics-in-rest-api-url/m-p/677435#M844</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi &lt;A href="https://community.esri.com/migrated-users/68046"&gt;Jay Johnson &lt;/A&gt;,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If you perform the query in REST (just like you did) - you just need to look at the URL that's generated. For example, I did the same thing you did and this was the resulting URL:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="https://services.arcgis.com/iCGWaR7ZHc5saRIl/ArcGIS/rest/services/Join_PatientZip_to_ZipCodes_Centroid/FeatureServer/0/query?where=&amp;amp;objectIds=&amp;amp;time=&amp;amp;geometry=&amp;amp;geometryType=esriGeometryEnvelope&amp;amp;inSR=&amp;amp;spatialRel=esriSpatialRelIntersects&amp;amp;resultType=none&amp;amp;distance=0.0&amp;amp;units=esriSRUnit_Meter&amp;amp;returnGeodetic=false&amp;amp;outFields=&amp;amp;returnGeometry=true&amp;amp;featureEncoding=esriDefault&amp;amp;multipatchOption=xyFootprint&amp;amp;maxAllowableOffset=&amp;amp;geometryPrecision=&amp;amp;outSR=&amp;amp;datumTransformation=&amp;amp;applyVCSProjection=false&amp;amp;returnIdsOnly=false&amp;amp;returnUniqueIdsOnly=false&amp;amp;returnCountOnly=false&amp;amp;returnExtentOnly=false&amp;amp;returnQueryGeometry=false&amp;amp;returnDistinctValues=false&amp;amp;cacheHint=false&amp;amp;orderByFields=&amp;amp;groupByFieldsForStatistics=zipcode_text&amp;amp;outStatistics=%5B%7B%22statisticType%22%3A%22count%22%2C%0D%0A%22onStatisticField%22%3A%22Case__%22%2C%0D%0A%22outStatisticsFieldName%22%3A%22Total%22%7D%5D&amp;amp;having=&amp;amp;resultOffset=&amp;amp;resultRecordCount=&amp;amp;returnZ=false&amp;amp;returnM=false&amp;amp;returnExceededLimitFeatures=true&amp;amp;quantizationParameters=&amp;amp;sqlFormat=none&amp;amp;f=html&amp;amp;token="&gt;https://services.arcgis.com/iCGWaR7ZHc5saRIl/ArcGIS/rest/services/Join_PatientZip_to_ZipCodes_Centroid/FeatureServer/0/query?where=&amp;amp;objectIds=&amp;amp;time=&amp;amp;geometry=&amp;amp;geometryType=esriGeometryEnvelope&amp;amp;inSR=&amp;amp;spatialRel=esriSpatialRelIntersects&amp;amp;resultType=none&amp;amp;distance=0.0&amp;amp;units=esriSRUnit_Meter&amp;amp;returnGeodetic=false&amp;amp;outFields=&amp;amp;returnGeometry=true&amp;amp;featureEncoding=esriDefault&amp;amp;multipatchOption=xyFootprint&amp;amp;maxAllowableOffset=&amp;amp;geometryPrecision=&amp;amp;outSR=&amp;amp;datumTransformation=&amp;amp;applyVCSProjection=false&amp;amp;returnIdsOnly=false&amp;amp;returnUniqueIdsOnly=false&amp;amp;returnCountOnly=false&amp;amp;returnExtentOnly=false&amp;amp;returnQueryGeometry=false&amp;amp;returnDistinctValues=false&amp;amp;cacheHint=false&amp;amp;orderByFields=&amp;amp;groupByFieldsForStatistics=zipcode_text&amp;amp;&lt;STRONG&gt;outStatistics=%5B%7B%22statisticType%22%3A%22count%22%2C%0D%0A%22onStatisticField%22%3A%22Case__%22%2C%0D%0A%22outStatisticsFieldName%22%3A%22Total%22%7D%5D&lt;/STRONG&gt;&amp;amp;having=&amp;amp;resultOffset=&amp;amp;resultRecordCount=&amp;amp;returnZ=false&amp;amp;returnM=false&amp;amp;returnExceededLimitFeatures=true&amp;amp;quantizationParameters=&amp;amp;sqlFormat=none&amp;amp;f=html&amp;amp;token=&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So it's already done the work for you - and completed the query.&lt;/P&gt;&lt;P&gt;&lt;IMG class="image-1 jive-image" src="https://community.esri.com/legacyfs/online/493755_pastedImage_6.png" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I will also sometimes use a URL decode/encode. If you copy the URL I pasted above above in this first box here&amp;nbsp;&lt;A class="link-titled" href="https://www.urldecoder.org/" title="https://www.urldecoder.org/"&gt;URL Decode and Encode - Online&lt;/A&gt;&amp;nbsp; and decode it, it will look like you expect:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="https://services.arcgis.com/iCGWaR7ZHc5saRIl/ArcGIS/rest/services/Join_PatientZip_to_ZipCodes_Centroid/FeatureServer/0/query?where=&amp;amp;objectIds=&amp;amp;time=&amp;amp;geometry=&amp;amp;geometryType=esriGeometryEnvelope&amp;amp;inSR=&amp;amp;spatialRel=esriSpatialRelIntersects&amp;amp;resultType=none&amp;amp;distance=0.0&amp;amp;units=esriSRUnit_Meter&amp;amp;returnGeodetic=false&amp;amp;outFields=&amp;amp;returnGeometry=true&amp;amp;featureEncoding=esriDefault&amp;amp;multipatchOption=xyFootprint&amp;amp;maxAllowableOffset=&amp;amp;geometryPrecision=&amp;amp;outSR=&amp;amp;datumTransformation=&amp;amp;applyVCSProjection=false&amp;amp;returnIdsOnly=false&amp;amp;returnUniqueIdsOnly=false&amp;amp;returnCountOnly=false&amp;amp;returnExtentOnly=false&amp;amp;returnQueryGeometry=false&amp;amp;returnDistinctValues=false&amp;amp;cacheHint=false&amp;amp;orderByFields=&amp;amp;groupByFieldsForStatistics=zipcode_text&amp;amp;o"&gt;https://services.arcgis.com/iCGWaR7ZHc5saRIl/ArcGIS/rest/services/Join_PatientZip_to_ZipCodes_Centroid/FeatureServer/0/query?where=&amp;amp;objectIds=&amp;amp;time=&amp;amp;geometry=&amp;amp;geometryType=esriGeometryEnvelope&amp;amp;inSR=&amp;amp;spatialRel=esriSpatialRelIntersects&amp;amp;resultType=none&amp;amp;distance=0.0&amp;amp;units=esriSRUnit_Meter&amp;amp;returnGeodetic=false&amp;amp;outFields=&amp;amp;returnGeometry=true&amp;amp;featureEncoding=esriDefault&amp;amp;multipatchOption=xyFootprint&amp;amp;maxAllowableOffset=&amp;amp;geometryPrecision=&amp;amp;outSR=&amp;amp;datumTransformation=&amp;amp;applyVCSProjection=false&amp;amp;returnIdsOnly=false&amp;amp;returnUniqueIdsOnly=false&amp;amp;returnCountOnly=false&amp;amp;returnExtentOnly=false&amp;amp;returnQueryGeometry=false&amp;amp;returnDistinctValues=false&amp;amp;cacheHint=false&amp;amp;orderByFields=&amp;amp;groupByFieldsForStatistics=zipcode_text&amp;amp;o&lt;/A&gt;&lt;STRONG&gt;utStatistics=[{"statisticType":"count",&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;"onStatisticField":"Case__",&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;"outStatisticsFieldName":"Total"}]&lt;/STRONG&gt;&amp;amp;having=&amp;amp;resultOffset=&amp;amp;resultRecordCount=&amp;amp;returnZ=false&amp;amp;returnM=false&amp;amp;returnExceededLimitFeatures=true&amp;amp;quantizationParameters=&amp;amp;sqlFormat=none&amp;amp;f=html&amp;amp;token=&lt;/P&gt;&lt;P&gt;&lt;IMG class="image-2 jive-image" src="https://community.esri.com/legacyfs/online/493756_pastedImage_7.png" /&gt;&lt;/P&gt;&lt;P&gt;So you can do the opposite to figure out how to encode something!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'm not 100% sure on the official "rules" if something needs to be encoded or not - but the above two strategies have worked for me &lt;IMG src="https://community.esri.com/legacyfs/online/emoticons/happy.png" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;- Sarah Ambrose&lt;/P&gt;&lt;P&gt;Product Engineer, Esri&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 28 May 2020 14:09:33 GMT</pubDate>
    <dc:creator>SarahAmbrose</dc:creator>
    <dc:date>2020-05-28T14:09:33Z</dc:date>
    <item>
      <title>groupByFieldsForStatistics in REST API URL?</title>
      <link>https://community.esri.com/t5/arcgis-online-developers-questions/groupbyfieldsforstatistics-in-rest-api-url/m-p/677433#M842</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I have an AGOL hosted view of Covid-19 case data that includes a zipcode polygon layer with a one to many&amp;nbsp;join to&amp;nbsp;a patient data table.&amp;nbsp; This hosted view was created using the AGOL Analysis, Summarize Data, Join Features tool.&amp;nbsp;&amp;nbsp;The patient data table has one row for each patient and a field for their ZIPCode.&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;A class="link-titled" href="https://services.arcgis.com/iCGWaR7ZHc5saRIl/arcgis/rest/services/Join_PatientZip_to_ZipCodes_Centroid/FeatureServer" title="https://services.arcgis.com/iCGWaR7ZHc5saRIl/arcgis/rest/services/Join_PatientZip_to_ZipCodes_Centroid/FeatureServer"&gt;https://services.arcgis.com/iCGWaR7ZHc5saRIl/arcgis/rest/services/Join_PatientZip_to_ZipCodes_Centroid/FeatureServer&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'd like to tally how many cases are in each ZIPCode polygon and add this to a webmap.&amp;nbsp; The data changes daily, so I'd like to do this as a view, not as a static layer.&lt;/P&gt;&lt;P&gt;I can successfully return summary numbers in the REST API Query as shown below.&amp;nbsp; The question is, how do I translate this into a URL string I can add as a data source to a webmap, where each zip code polygon has a count of total cases?&lt;/P&gt;&lt;P&gt;&lt;IMG class="image-1 jive-image" src="https://community.esri.com/legacyfs/online/493500_pastedImage_6.png" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It seems like I should be able to append a URL string to the REST endpoint given above (yes?).&amp;nbsp; Something along the lines of:&lt;/P&gt;&lt;P&gt;&amp;amp;groupByFieldsForStatistics="zipcode_text"&amp;amp;outStatistics="&lt;STRONG&gt;somethingelse&lt;/STRONG&gt;"&amp;nbsp; &amp;nbsp;Apparently I don't know how to construct the "somethingelse" portion of the string properly.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Is this the right approach?&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Jay&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 26 May 2020 20:12:40 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-online-developers-questions/groupbyfieldsforstatistics-in-rest-api-url/m-p/677433#M842</guid>
      <dc:creator>JayJohnsonWashoeCounty</dc:creator>
      <dc:date>2020-05-26T20:12:40Z</dc:date>
    </item>
    <item>
      <title>Re: groupByFieldsForStatistics in REST API URL?</title>
      <link>https://community.esri.com/t5/arcgis-online-developers-questions/groupbyfieldsforstatistics-in-rest-api-url/m-p/677434#M843</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;If you execute a query in a service, the parameters you supplied will be created in the URL. Although it will have extra query parameters that are unused and you can weed these out.&amp;nbsp; Btw, didn't you want to group by ZipCode?&lt;/P&gt;&lt;P&gt;&lt;A href="https://services.arcgis.com/iCGWaR7ZHc5saRIl/ArcGIS/rest/services/Join_PatientZip_to_ZipCodes_Centroid/FeatureServer/0/query?where=OBJECTID%3E0&amp;amp;objectIds=&amp;amp;time=&amp;amp;geometry=&amp;amp;geometryType=esriGeometryEnvelope&amp;amp;inSR=&amp;amp;spatialRel=esriSpatialRelIntersects&amp;amp;resultType=none&amp;amp;distance=0.0&amp;amp;units=esriSRUnit_Meter&amp;amp;returnGeodetic=false&amp;amp;outFields=&amp;amp;returnGeometry=true&amp;amp;featureEncoding=esriDefault&amp;amp;multipatchOption=xyFootprint&amp;amp;maxAllowableOffset=&amp;amp;geometryPrecision=&amp;amp;outSR=&amp;amp;datumTransformation=&amp;amp;applyVCSProjection=false&amp;amp;returnIdsOnly=false&amp;amp;returnUniqueIdsOnly=false&amp;amp;returnCountOnly=false&amp;amp;returnExtentOnly=false&amp;amp;returnQueryGeometry=false&amp;amp;returnDistinctValues=false&amp;amp;cacheHint=false&amp;amp;orderByFields=zipcode&amp;amp;groupByFieldsForStatistics=+ZIPCODE&amp;amp;outStatistics=+%5B%7B%0D%0A++++%22statisticType%22%3A+%22count%22%2C%0D%0A++++%22onStatisticField%22%3A+%22zipcode%22%2C%0D%0A++++%22outStatisticFieldName%22%3A+%22ZipCount%22%0D%0A++%7D%5D&amp;amp;having=&amp;amp;resultOffset=&amp;amp;resultRecordCount=&amp;amp;returnZ=false&amp;amp;returnM=false&amp;amp;returnExceededLimitFeatures=true&amp;amp;quantizationParameters=&amp;amp;sqlFormat=standard&amp;amp;f=html&amp;amp;token="&gt;https://services.arcgis.com/iCGWaR7ZHc5saRIl/ArcGIS/rest/services/Join_PatientZip_to_ZipCodes_Centroid/FeatureServer/0/query?where=OBJECTID%3E0&amp;amp;objectIds=&amp;amp;time=&amp;amp;geometry=&amp;amp;geometryType=esriGeometryEnvelope&amp;amp;inSR=&amp;amp;spatialRel=esriSpatialRelIntersects&amp;amp;resultType=none&amp;amp;distance=0.0&amp;amp;units=esriSRUnit_Meter&amp;amp;returnGeodetic=false&amp;amp;outFields=&amp;amp;returnGeometry=true&amp;amp;featureEncoding=esriDefault&amp;amp;multipatchOption=xyFootprint&amp;amp;maxAllowableOffset=&amp;amp;geometryPrecision=&amp;amp;outSR=&amp;amp;datumTransformation=&amp;amp;applyVCSProjection=false&amp;amp;returnIdsOnly=false&amp;amp;returnUniqueIdsOnly=false&amp;amp;returnCountOnly=false&amp;amp;returnExtentOnly=false&amp;amp;returnQueryGeometry=false&amp;amp;returnDistinctValues=false&amp;amp;cacheHint=false&amp;amp;orderByFields=zipcode&amp;amp;groupByFieldsForStatistics=+ZIPCODE&amp;amp;outStatistics=+%5B%7B%0D%0A++++%22statisticType%22%3A+%22count%22%2C%0D%0A++++%22onStatisticField%22%3A+%22zipcode%22%2C%0D%0A++++%22outStatisticFieldName%22%3A+%22ZipCount%22%0D%0A++%7D%5D&amp;amp;having=&amp;amp;resultOffset=&amp;amp;resultRecordCount=&amp;amp;returnZ=false&amp;amp;returnM=false&amp;amp;returnExceededLimitFeatures=true&amp;amp;quantizationParameters=&amp;amp;sqlFormat=standard&amp;amp;f=html&amp;amp;token=&lt;/A&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 28 May 2020 14:05:44 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-online-developers-questions/groupbyfieldsforstatistics-in-rest-api-url/m-p/677434#M843</guid>
      <dc:creator>DaleCasale</dc:creator>
      <dc:date>2020-05-28T14:05:44Z</dc:date>
    </item>
    <item>
      <title>Re: groupByFieldsForStatistics in REST API URL?</title>
      <link>https://community.esri.com/t5/arcgis-online-developers-questions/groupbyfieldsforstatistics-in-rest-api-url/m-p/677435#M844</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi &lt;A href="https://community.esri.com/migrated-users/68046"&gt;Jay Johnson &lt;/A&gt;,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If you perform the query in REST (just like you did) - you just need to look at the URL that's generated. For example, I did the same thing you did and this was the resulting URL:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="https://services.arcgis.com/iCGWaR7ZHc5saRIl/ArcGIS/rest/services/Join_PatientZip_to_ZipCodes_Centroid/FeatureServer/0/query?where=&amp;amp;objectIds=&amp;amp;time=&amp;amp;geometry=&amp;amp;geometryType=esriGeometryEnvelope&amp;amp;inSR=&amp;amp;spatialRel=esriSpatialRelIntersects&amp;amp;resultType=none&amp;amp;distance=0.0&amp;amp;units=esriSRUnit_Meter&amp;amp;returnGeodetic=false&amp;amp;outFields=&amp;amp;returnGeometry=true&amp;amp;featureEncoding=esriDefault&amp;amp;multipatchOption=xyFootprint&amp;amp;maxAllowableOffset=&amp;amp;geometryPrecision=&amp;amp;outSR=&amp;amp;datumTransformation=&amp;amp;applyVCSProjection=false&amp;amp;returnIdsOnly=false&amp;amp;returnUniqueIdsOnly=false&amp;amp;returnCountOnly=false&amp;amp;returnExtentOnly=false&amp;amp;returnQueryGeometry=false&amp;amp;returnDistinctValues=false&amp;amp;cacheHint=false&amp;amp;orderByFields=&amp;amp;groupByFieldsForStatistics=zipcode_text&amp;amp;outStatistics=%5B%7B%22statisticType%22%3A%22count%22%2C%0D%0A%22onStatisticField%22%3A%22Case__%22%2C%0D%0A%22outStatisticsFieldName%22%3A%22Total%22%7D%5D&amp;amp;having=&amp;amp;resultOffset=&amp;amp;resultRecordCount=&amp;amp;returnZ=false&amp;amp;returnM=false&amp;amp;returnExceededLimitFeatures=true&amp;amp;quantizationParameters=&amp;amp;sqlFormat=none&amp;amp;f=html&amp;amp;token="&gt;https://services.arcgis.com/iCGWaR7ZHc5saRIl/ArcGIS/rest/services/Join_PatientZip_to_ZipCodes_Centroid/FeatureServer/0/query?where=&amp;amp;objectIds=&amp;amp;time=&amp;amp;geometry=&amp;amp;geometryType=esriGeometryEnvelope&amp;amp;inSR=&amp;amp;spatialRel=esriSpatialRelIntersects&amp;amp;resultType=none&amp;amp;distance=0.0&amp;amp;units=esriSRUnit_Meter&amp;amp;returnGeodetic=false&amp;amp;outFields=&amp;amp;returnGeometry=true&amp;amp;featureEncoding=esriDefault&amp;amp;multipatchOption=xyFootprint&amp;amp;maxAllowableOffset=&amp;amp;geometryPrecision=&amp;amp;outSR=&amp;amp;datumTransformation=&amp;amp;applyVCSProjection=false&amp;amp;returnIdsOnly=false&amp;amp;returnUniqueIdsOnly=false&amp;amp;returnCountOnly=false&amp;amp;returnExtentOnly=false&amp;amp;returnQueryGeometry=false&amp;amp;returnDistinctValues=false&amp;amp;cacheHint=false&amp;amp;orderByFields=&amp;amp;groupByFieldsForStatistics=zipcode_text&amp;amp;&lt;STRONG&gt;outStatistics=%5B%7B%22statisticType%22%3A%22count%22%2C%0D%0A%22onStatisticField%22%3A%22Case__%22%2C%0D%0A%22outStatisticsFieldName%22%3A%22Total%22%7D%5D&lt;/STRONG&gt;&amp;amp;having=&amp;amp;resultOffset=&amp;amp;resultRecordCount=&amp;amp;returnZ=false&amp;amp;returnM=false&amp;amp;returnExceededLimitFeatures=true&amp;amp;quantizationParameters=&amp;amp;sqlFormat=none&amp;amp;f=html&amp;amp;token=&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So it's already done the work for you - and completed the query.&lt;/P&gt;&lt;P&gt;&lt;IMG class="image-1 jive-image" src="https://community.esri.com/legacyfs/online/493755_pastedImage_6.png" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I will also sometimes use a URL decode/encode. If you copy the URL I pasted above above in this first box here&amp;nbsp;&lt;A class="link-titled" href="https://www.urldecoder.org/" title="https://www.urldecoder.org/"&gt;URL Decode and Encode - Online&lt;/A&gt;&amp;nbsp; and decode it, it will look like you expect:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="https://services.arcgis.com/iCGWaR7ZHc5saRIl/ArcGIS/rest/services/Join_PatientZip_to_ZipCodes_Centroid/FeatureServer/0/query?where=&amp;amp;objectIds=&amp;amp;time=&amp;amp;geometry=&amp;amp;geometryType=esriGeometryEnvelope&amp;amp;inSR=&amp;amp;spatialRel=esriSpatialRelIntersects&amp;amp;resultType=none&amp;amp;distance=0.0&amp;amp;units=esriSRUnit_Meter&amp;amp;returnGeodetic=false&amp;amp;outFields=&amp;amp;returnGeometry=true&amp;amp;featureEncoding=esriDefault&amp;amp;multipatchOption=xyFootprint&amp;amp;maxAllowableOffset=&amp;amp;geometryPrecision=&amp;amp;outSR=&amp;amp;datumTransformation=&amp;amp;applyVCSProjection=false&amp;amp;returnIdsOnly=false&amp;amp;returnUniqueIdsOnly=false&amp;amp;returnCountOnly=false&amp;amp;returnExtentOnly=false&amp;amp;returnQueryGeometry=false&amp;amp;returnDistinctValues=false&amp;amp;cacheHint=false&amp;amp;orderByFields=&amp;amp;groupByFieldsForStatistics=zipcode_text&amp;amp;o"&gt;https://services.arcgis.com/iCGWaR7ZHc5saRIl/ArcGIS/rest/services/Join_PatientZip_to_ZipCodes_Centroid/FeatureServer/0/query?where=&amp;amp;objectIds=&amp;amp;time=&amp;amp;geometry=&amp;amp;geometryType=esriGeometryEnvelope&amp;amp;inSR=&amp;amp;spatialRel=esriSpatialRelIntersects&amp;amp;resultType=none&amp;amp;distance=0.0&amp;amp;units=esriSRUnit_Meter&amp;amp;returnGeodetic=false&amp;amp;outFields=&amp;amp;returnGeometry=true&amp;amp;featureEncoding=esriDefault&amp;amp;multipatchOption=xyFootprint&amp;amp;maxAllowableOffset=&amp;amp;geometryPrecision=&amp;amp;outSR=&amp;amp;datumTransformation=&amp;amp;applyVCSProjection=false&amp;amp;returnIdsOnly=false&amp;amp;returnUniqueIdsOnly=false&amp;amp;returnCountOnly=false&amp;amp;returnExtentOnly=false&amp;amp;returnQueryGeometry=false&amp;amp;returnDistinctValues=false&amp;amp;cacheHint=false&amp;amp;orderByFields=&amp;amp;groupByFieldsForStatistics=zipcode_text&amp;amp;o&lt;/A&gt;&lt;STRONG&gt;utStatistics=[{"statisticType":"count",&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;"onStatisticField":"Case__",&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;"outStatisticsFieldName":"Total"}]&lt;/STRONG&gt;&amp;amp;having=&amp;amp;resultOffset=&amp;amp;resultRecordCount=&amp;amp;returnZ=false&amp;amp;returnM=false&amp;amp;returnExceededLimitFeatures=true&amp;amp;quantizationParameters=&amp;amp;sqlFormat=none&amp;amp;f=html&amp;amp;token=&lt;/P&gt;&lt;P&gt;&lt;IMG class="image-2 jive-image" src="https://community.esri.com/legacyfs/online/493756_pastedImage_7.png" /&gt;&lt;/P&gt;&lt;P&gt;So you can do the opposite to figure out how to encode something!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'm not 100% sure on the official "rules" if something needs to be encoded or not - but the above two strategies have worked for me &lt;IMG src="https://community.esri.com/legacyfs/online/emoticons/happy.png" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;- Sarah Ambrose&lt;/P&gt;&lt;P&gt;Product Engineer, Esri&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 28 May 2020 14:09:33 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-online-developers-questions/groupbyfieldsforstatistics-in-rest-api-url/m-p/677435#M844</guid>
      <dc:creator>SarahAmbrose</dc:creator>
      <dc:date>2020-05-28T14:09:33Z</dc:date>
    </item>
    <item>
      <title>Re: groupByFieldsForStatistics in REST API URL?</title>
      <link>https://community.esri.com/t5/arcgis-online-developers-questions/groupbyfieldsforstatistics-in-rest-api-url/m-p/677436#M845</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;So the answer was RIGHT THERE all along.&amp;nbsp; Thanks!&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 28 May 2020 14:18:04 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-online-developers-questions/groupbyfieldsforstatistics-in-rest-api-url/m-p/677436#M845</guid>
      <dc:creator>JayJohnsonWashoeCounty</dc:creator>
      <dc:date>2020-05-28T14:18:04Z</dc:date>
    </item>
    <item>
      <title>Re: groupByFieldsForStatistics in REST API URL?</title>
      <link>https://community.esri.com/t5/arcgis-online-developers-questions/groupbyfieldsforstatistics-in-rest-api-url/m-p/677437#M846</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Sarah, Thanks for expanding on Dale's answer.&amp;nbsp; And that&amp;nbsp;&lt;SPAN style="background-color: #ffffff;"&gt;&lt;STRONG&gt;URL decode/encode&lt;/STRONG&gt; looks useful - thanks for the pointer!&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 28 May 2020 14:20:03 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-online-developers-questions/groupbyfieldsforstatistics-in-rest-api-url/m-p/677437#M846</guid>
      <dc:creator>JayJohnsonWashoeCounty</dc:creator>
      <dc:date>2020-05-28T14:20:03Z</dc:date>
    </item>
    <item>
      <title>Re: groupByFieldsForStatistics in REST API URL?</title>
      <link>https://community.esri.com/t5/arcgis-online-developers-questions/groupbyfieldsforstatistics-in-rest-api-url/m-p/677438#M847</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Sarah, Should I be able to take that resultant URL and add it to an AGOL map (Add from web)?&amp;nbsp; I'm getting the result I want in the Query interface, but when I try to add the URL that includes the query string into a web map, I'm not successful.&lt;/P&gt;&lt;P&gt;&lt;IMG __jive_id="493802" class="image-1 jive-image" src="https://community.esri.com/legacyfs/online/493802_pastedImage_2.png" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Do I need to be creating a layer view and making changes to the view definition instead of pursuing this URL approach?&lt;/P&gt;&lt;P&gt;Jay&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 28 May 2020 16:45:28 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-online-developers-questions/groupbyfieldsforstatistics-in-rest-api-url/m-p/677438#M847</guid>
      <dc:creator>JayJohnsonWashoeCounty</dc:creator>
      <dc:date>2020-05-28T16:45:28Z</dc:date>
    </item>
    <item>
      <title>Re: groupByFieldsForStatistics in REST API URL?</title>
      <link>https://community.esri.com/t5/arcgis-online-developers-questions/groupbyfieldsforstatistics-in-rest-api-url/m-p/677439#M848</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hey &lt;A href="https://community.esri.com/migrated-users/68046"&gt;Jay Johnson &lt;/A&gt;,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Sorry about that - focused on the technical part of your question (the query itself) and not the actual over-arching question. I do not expect that you would be able to add that to your map. When you summarize the data you now have a table - so there isn't really a geometry associated with it. You might be able to try joining the data to itself to calculate the count value in the tool (instead of the REST endpoint).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;- Sarah&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 28 May 2020 17:25:01 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-online-developers-questions/groupbyfieldsforstatistics-in-rest-api-url/m-p/677439#M848</guid>
      <dc:creator>SarahAmbrose</dc:creator>
      <dc:date>2020-05-28T17:25:01Z</dc:date>
    </item>
  </channel>
</rss>

