<?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: Javascript function returns code:499, token required - how can I query the feature layer? in ArcGIS Survey123 Questions</title>
    <link>https://community.esri.com/t5/arcgis-survey123-questions/javascript-function-returns-code-499-token/m-p/1164153#M42084</link>
    <description>&lt;P&gt;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/2929"&gt;@IsmaelChivite&lt;/a&gt;&amp;nbsp;thank you so much for this! It's working.....for the most part.&lt;/P&gt;&lt;P&gt;Sometimes, the query is successful and it returns the JSON, as intended.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Katherine_Clark_2-1649885870506.png" style="width: 614px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/38836i203311B3789E7AF0/image-dimensions/614x132?v=v2" width="614" height="132" role="button" title="Katherine_Clark_2-1649885870506.png" alt="Katherine_Clark_2-1649885870506.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Other times, it returns a 500 error.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Katherine_Clark_1-1649885848608.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/38835i2C5B2B29E8ECC3FD/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Katherine_Clark_1-1649885848608.png" alt="Katherine_Clark_1-1649885848608.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Also, on occasion I've had it just return '0' as well.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Katherine_Clark_0-1649886562516.png" style="width: 91px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/38837iAE7BEF4425E0BCFF/image-dimensions/91x55?v=v2" width="91" height="55" role="button" title="Katherine_Clark_0-1649886562516.png" alt="Katherine_Clark_0-1649886562516.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Are these two errors simply due to the size of the service? I am querying &lt;A href="https://landscape11.arcgis.com/arcgis/rest/services/USA_Wetlands/MapServer/0" target="_blank" rel="noopener"&gt;this&lt;/A&gt; service specifically in my script.&lt;/P&gt;&lt;P&gt;If it is due to size, is there any method to get around that limitation?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Wed, 13 Apr 2022 21:49:40 GMT</pubDate>
    <dc:creator>Katie_Clark</dc:creator>
    <dc:date>2022-04-13T21:49:40Z</dc:date>
    <item>
      <title>Javascript function returns code:499, token required - how can I query the feature layer?</title>
      <link>https://community.esri.com/t5/arcgis-survey123-questions/javascript-function-returns-code-499-token/m-p/1162683#M41998</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;I use several JavaScript functions in my survey to query features layers from the living atlas to auto-populate certain fields in the survey. (i.e. city and county name, etc)&lt;/P&gt;&lt;P&gt;I'd like to also query the&amp;nbsp;&lt;A href="https://landscape11.arcgis.com/arcgis/rest/services/USA_Wetlands/FeatureServer" target="_blank" rel="noopener"&gt;NWI&lt;/A&gt; layer, which is in the living atlas but is marked as "exclusive content for subscribers". Using the same type of script like I did for the other data returns &lt;STRONG&gt;{"code":499,"message":"Token Required","details":[]}&lt;/STRONG&gt;, which makes sense since it requires a login to view the data.&lt;/P&gt;&lt;P&gt;Is there a way to utilize the credentials that were used to login to Survey123 within a script so that I can query this layer?&lt;/P&gt;&lt;P&gt;Thanks in advance for any assistance!&lt;/P&gt;</description>
      <pubDate>Fri, 08 Apr 2022 19:08:50 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-survey123-questions/javascript-function-returns-code-499-token/m-p/1162683#M41998</guid>
      <dc:creator>Katie_Clark</dc:creator>
      <dc:date>2022-04-08T19:08:50Z</dc:date>
    </item>
    <item>
      <title>Re: Javascript function returns code:499, token required - how can I query the feature layer?</title>
      <link>https://community.esri.com/t5/arcgis-survey123-questions/javascript-function-returns-code-499-token/m-p/1163216#M42021</link>
      <description>&lt;P&gt;Hi &lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/232739"&gt;@Katie_Clark&lt;/a&gt;&amp;nbsp;&amp;nbsp; If you are using a custom JS function to query a layer, you will need to pass the token from the logged-in user. You can get the token with &lt;STRONG&gt;pulldata("@property", "token")&lt;/STRONG&gt; and then use that in your JS logic.&amp;nbsp; The only thing to keep in mind is that if your logged-in user is connecting to ArcGIS Enterprise, the token will not be valid against an ArcGIS Online layer from the Living Atlas of the World.&lt;/P&gt;&lt;P&gt;Alternatively, if you want ArcGIS Survey123 to handle the token business in your behalf, you can try the new Beta pullata("@layer", "getRecordAt") function.&amp;nbsp; You will find more info about this function in the last section of &lt;A href="https://community.esri.com/t5/arcgis-survey123-blog/survey123-april-2022-now-available-in-beta/ba-p/1161436" target="_blank" rel="noopener"&gt;https://community.esri.com/t5/arcgis-survey123-blog/survey123-april-2022-now-available-in-beta/ba-p/1161436 &lt;/A&gt;&lt;/P&gt;&lt;P&gt;As with custom JS functions, the pulldata("@layer") functions will not be able to use an ArcGIS Enterprise token against an ArcGIS Online secure layer.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 12 Apr 2022 00:09:58 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-survey123-questions/javascript-function-returns-code-499-token/m-p/1163216#M42021</guid>
      <dc:creator>IsmaelChivite</dc:creator>
      <dc:date>2022-04-12T00:09:58Z</dc:date>
    </item>
    <item>
      <title>Re: Javascript function returns code:499, token required - how can I query the feature layer?</title>
      <link>https://community.esri.com/t5/arcgis-survey123-questions/javascript-function-returns-code-499-token/m-p/1163218#M42022</link>
      <description>&lt;P&gt;This is great, thanks so much for the response Ismael! I'll give it a try later today.&lt;/P&gt;</description>
      <pubDate>Mon, 11 Apr 2022 19:35:18 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-survey123-questions/javascript-function-returns-code-499-token/m-p/1163218#M42022</guid>
      <dc:creator>Katie_Clark</dc:creator>
      <dc:date>2022-04-11T19:35:18Z</dc:date>
    </item>
    <item>
      <title>Re: Javascript function returns code:499, token required - how can I query the feature layer?</title>
      <link>https://community.esri.com/t5/arcgis-survey123-questions/javascript-function-returns-code-499-token/m-p/1164153#M42084</link>
      <description>&lt;P&gt;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/2929"&gt;@IsmaelChivite&lt;/a&gt;&amp;nbsp;thank you so much for this! It's working.....for the most part.&lt;/P&gt;&lt;P&gt;Sometimes, the query is successful and it returns the JSON, as intended.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Katherine_Clark_2-1649885870506.png" style="width: 614px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/38836i203311B3789E7AF0/image-dimensions/614x132?v=v2" width="614" height="132" role="button" title="Katherine_Clark_2-1649885870506.png" alt="Katherine_Clark_2-1649885870506.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Other times, it returns a 500 error.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Katherine_Clark_1-1649885848608.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/38835i2C5B2B29E8ECC3FD/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Katherine_Clark_1-1649885848608.png" alt="Katherine_Clark_1-1649885848608.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Also, on occasion I've had it just return '0' as well.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Katherine_Clark_0-1649886562516.png" style="width: 91px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/38837iAE7BEF4425E0BCFF/image-dimensions/91x55?v=v2" width="91" height="55" role="button" title="Katherine_Clark_0-1649886562516.png" alt="Katherine_Clark_0-1649886562516.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Are these two errors simply due to the size of the service? I am querying &lt;A href="https://landscape11.arcgis.com/arcgis/rest/services/USA_Wetlands/MapServer/0" target="_blank" rel="noopener"&gt;this&lt;/A&gt; service specifically in my script.&lt;/P&gt;&lt;P&gt;If it is due to size, is there any method to get around that limitation?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 13 Apr 2022 21:49:40 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-survey123-questions/javascript-function-returns-code-499-token/m-p/1164153#M42084</guid>
      <dc:creator>Katie_Clark</dc:creator>
      <dc:date>2022-04-13T21:49:40Z</dc:date>
    </item>
  </channel>
</rss>

