<?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: Properly change the format of queries in ArcGIS JavaScript Maps SDK Questions</title>
    <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/properly-change-the-format-of-queries/m-p/1059279#M73171</link>
    <description>&lt;P&gt;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/183503"&gt;@ArnoFiva&lt;/a&gt;&amp;nbsp;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/129389"&gt;@ShanonLoughton&lt;/a&gt;&amp;nbsp;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/19419"&gt;@YannCabon&lt;/a&gt;&amp;nbsp;&lt;BR /&gt;Does the interceptors solution you have provided work with JS API 3.x version?&lt;/P&gt;</description>
    <pubDate>Wed, 19 May 2021 02:24:29 GMT</pubDate>
    <dc:creator>viewprogisdev</dc:creator>
    <dc:date>2021-05-19T02:24:29Z</dc:date>
    <item>
      <title>Properly change the format of queries</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/properly-change-the-format-of-queries/m-p/181646#M16859</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi&lt;/P&gt;&lt;P&gt;For a particular situation, in ArcGIS for JS API 4.15 I am trying to force a particular format of all Feature Server (FS) queries to JSON (f=json, or f=pjson), regardless of the ArcGIS Server's (10.7.1) &amp;gt; Feature Service's &amp;gt; Layer config params, such as&amp;nbsp; &lt;STRONG&gt;SupportedQueryFormats: JSON, GeoJSON, PBF&lt;/STRONG&gt;. It looks like PBF is preferred to be used by clients, if it is available.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have forced&amp;nbsp;f=json&amp;nbsp;with esri.Config.request successfully:&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;require([
 "esri/config",
 ...
 ], function(esriConfig,...) {
 &amp;nbsp;&amp;nbsp;&amp;nbsp;esriConfig.request.interceptors.push({ 
 &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;before(params) {
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;if (params.url.includes("query")) {
 &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;params.requestOptions.query.f = 'json';
 &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}
&amp;nbsp;&amp;nbsp;&amp;nbsp; }
   ...
 });&lt;/PRE&gt;&lt;P&gt;which works at the call level. However when the query is originally PBF, the client JS SDK is expecting it to come back and be parsed as PBF still, even though I have intercepted the initial request. I know this because the FL does not display on the web map and I get the console error:&lt;/P&gt;&lt;P&gt;&lt;SPAN class="" style="color: #222222; background-color: #fff0f0; margin-left: 4px;"&gt;&lt;SPAN class="" style="color: #545454; text-decoration: underline;"&gt;dojo-lite.js:261&lt;/SPAN&gt; &lt;/SPAN&gt;&lt;SPAN class="" style="color: var(--error-text-color)  !important; background-color: #fff0f0;"&gt;[esri.tasks.operations.pbfFeatureServiceParser]&lt;/SPAN&gt;&lt;/P&gt;&lt;DIV class="" style="color: var(--error-text-color)  !important; font-size: 12px !important;"&gt;&lt;DIV class=""&gt;&lt;OL class="" style="color: #212121 !important; font-size: 12px !important;"&gt;&lt;LI class=""&gt;&lt;SPAN class=""&gt;&lt;SPAN class=""&gt;f&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN class=""&gt;{&lt;SPAN class="" style="color: #565656;"&gt;name&lt;/SPAN&gt;: &lt;SPAN class="" style="color: #c41a16;"&gt;"query:parsing-pbf"&lt;/SPAN&gt;, &lt;SPAN class="" style="color: #565656;"&gt;message&lt;/SPAN&gt;: &lt;SPAN class="" style="color: #c41a16;"&gt;"Error while parsing FeatureSet PBF payload"&lt;/SPAN&gt;, &lt;SPAN class="" style="color: #565656;"&gt;details&lt;/SPAN&gt;: &lt;SPAN class=""&gt;{…}&lt;/SPAN&gt;}&lt;/SPAN&gt;&lt;SPAN class="" style="color: white; background-color: #b3cbf7; font-size: 9px; margin: 0px 6px;"&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;OL class="" style="padding-left: 12px;"&gt;&lt;LI class=""&gt;&lt;SPAN class=""&gt;&lt;SPAN class="" style="color: #881391;"&gt;details&lt;/SPAN&gt;:&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN class=""&gt;&lt;SPAN class=""&gt;{&lt;SPAN class="" style="color: #565656;"&gt;error&lt;/SPAN&gt;:&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN class=""&gt;Error: Invalid data type! at c.skip (&lt;A href="https://js.arcgis.com/4.15/dojo/dojo-lite.js:726:180" target="_blank"&gt;https://js.arcgis.com/4.15/dojo/dojo-lite.js:726:180&lt;/A&gt;) …&lt;/SPAN&gt;}&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/LI&gt;&lt;LI&gt;&lt;SPAN class=""&gt;&lt;SPAN class="" style="color: #881391;"&gt;message&lt;/SPAN&gt;:&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN class="" style="color: #c41a16;"&gt;&lt;SPAN class="" style="color: #222222;"&gt;"&lt;/SPAN&gt;Error while parsing FeatureSet PBF payload&lt;SPAN class="" style="color: #222222;"&gt;"&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/LI&gt;&lt;LI class=""&gt;&lt;SPAN class=""&gt;&lt;SPAN class="" style="color: #881391;"&gt;name&lt;/SPAN&gt;:&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN class="" style="color: #c41a16;"&gt;&lt;SPAN class="" style="color: #222222;"&gt;"&lt;/SPAN&gt;query:parsing-pbf&lt;SPAN class="" style="color: #222222;"&gt;"&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/LI&gt;&lt;LI class=""&gt;&lt;SPAN class=""&gt;&lt;SPAN class="" style="color: #c41a16;"&gt;&lt;SPAN class="" style="color: #222222;"&gt;...&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/LI&gt;&lt;/OL&gt;&lt;/LI&gt;&lt;/OL&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Is this a bug in ArcGIS for JS API?&lt;/P&gt;&lt;P&gt;Is there a more robust way to change the FS query format from the client?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 12 Dec 2021 16:09:15 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/properly-change-the-format-of-queries/m-p/181646#M16859</guid>
      <dc:creator>ShanonLoughton</dc:creator>
      <dc:date>2021-12-12T16:09:15Z</dc:date>
    </item>
    <item>
      <title>Re: Properly change the format of queries</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/properly-change-the-format-of-queries/m-p/181647#M16860</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Shanon,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;We don't have a proper way to disable pbf at the moment. You are on the right track to use interceptors.&lt;/P&gt;&lt;P&gt;It would work if you intercept the call to the service info, and override the supported query formats to only have JSON.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;CODE&gt;        esriConfig&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;request&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;interceptors&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;&lt;SPAN class="token function"&gt;push&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;{&lt;/SPAN&gt;
          urls&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt; &lt;SPAN class="regex token"&gt;/FeatureServer\/\d+$/&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt;
          after&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt; &lt;SPAN class="keyword token"&gt;function&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;response&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;{&lt;/SPAN&gt;
            response&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;data&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;supportedQueryFormats &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"JSON"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;
          &lt;SPAN class="punctuation token"&gt;}&lt;/SPAN&gt;
        &lt;SPAN class="punctuation token"&gt;}&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;‍‍‍‍‍‍‍‍‍‍‍‍‍&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Cheers&lt;/P&gt;&lt;P&gt;Yann&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 09:16:47 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/properly-change-the-format-of-queries/m-p/181647#M16860</guid>
      <dc:creator>YannCabon</dc:creator>
      <dc:date>2021-12-11T09:16:47Z</dc:date>
    </item>
    <item>
      <title>Re: Properly change the format of queries</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/properly-change-the-format-of-queries/m-p/1059279#M73171</link>
      <description>&lt;P&gt;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/183503"&gt;@ArnoFiva&lt;/a&gt;&amp;nbsp;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/129389"&gt;@ShanonLoughton&lt;/a&gt;&amp;nbsp;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/19419"&gt;@YannCabon&lt;/a&gt;&amp;nbsp;&lt;BR /&gt;Does the interceptors solution you have provided work with JS API 3.x version?&lt;/P&gt;</description>
      <pubDate>Wed, 19 May 2021 02:24:29 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/properly-change-the-format-of-queries/m-p/1059279#M73171</guid>
      <dc:creator>viewprogisdev</dc:creator>
      <dc:date>2021-05-19T02:24:29Z</dc:date>
    </item>
    <item>
      <title>Re: Properly change the format of queries</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/properly-change-the-format-of-queries/m-p/1061942#M73285</link>
      <description>&lt;P&gt;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/485515"&gt;@viewprogisdev&lt;/a&gt;&amp;nbsp;- at 3x, we have a setRequestPreCallback method that is fairly similar. See here:&lt;/P&gt;&lt;P&gt;&lt;A href="https://developers.arcgis.com/javascript/3/jsapi/esri.request-amd.html#esrirequest.setrequestprecallback" target="_blank"&gt;https://developers.arcgis.com/javascript/3/jsapi/esri.request-amd.html#esrirequest.setrequestprecallback&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 26 May 2021 17:52:10 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/properly-change-the-format-of-queries/m-p/1061942#M73285</guid>
      <dc:creator>Noah-Sager</dc:creator>
      <dc:date>2021-05-26T17:52:10Z</dc:date>
    </item>
    <item>
      <title>Re: Properly change the format of queries</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/properly-change-the-format-of-queries/m-p/1101103#M74752</link>
      <description>&lt;P&gt;has this been addressed? We are having trouble serving pbf files.&amp;nbsp; WE need to disable from the server side as we cannot control what the application requests.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 23 Sep 2021 02:16:06 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/properly-change-the-format-of-queries/m-p/1101103#M74752</guid>
      <dc:creator>JeffPace1</dc:creator>
      <dc:date>2021-09-23T02:16:06Z</dc:date>
    </item>
    <item>
      <title>Re: Properly change the format of queries</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/properly-change-the-format-of-queries/m-p/1218687#M78903</link>
      <description>&lt;P&gt;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/443810"&gt;@JeffPace1&lt;/a&gt;&amp;nbsp;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/129389"&gt;@ShanonLoughton&lt;/a&gt;&amp;nbsp;I am having a similar issue. Did either of you ever figure out a resolution?&lt;/P&gt;</description>
      <pubDate>Tue, 04 Oct 2022 16:14:07 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/properly-change-the-format-of-queries/m-p/1218687#M78903</guid>
      <dc:creator>LanceKirby2</dc:creator>
      <dc:date>2022-10-04T16:14:07Z</dc:date>
    </item>
    <item>
      <title>Re: Properly change the format of queries</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/properly-change-the-format-of-queries/m-p/1580465#M86447</link>
      <description>&lt;P&gt;This appears to still be an issue that I cannot resolve?&amp;nbsp; I have a feature service that when I "Zoom to" one of the records it comes back with the error of "&lt;SPAN&gt;Error while parsing FeatureSet PBF payload".&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 30 Jan 2025 17:05:22 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/properly-change-the-format-of-queries/m-p/1580465#M86447</guid>
      <dc:creator>MKa</dc:creator>
      <dc:date>2025-01-30T17:05:22Z</dc:date>
    </item>
  </channel>
</rss>

