<?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 pulldata @layer for rasters in ArcGIS Survey123 Questions</title>
    <link>https://community.esri.com/t5/arcgis-survey123-questions/pulldata-layer-for-rasters/m-p/1644084#M63879</link>
    <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;In Survey123 I am trying to query a DEM raster layer from map lick or coordinates with pulldata&amp;nbsp;@layer but cannot find how to read the stretch.pixel value. Under the layer's service page, Fields is &lt;EM&gt;None&amp;nbsp;&lt;/EM&gt;so not sure what to put in for "attributes"&lt;/P&gt;</description>
    <pubDate>Thu, 21 Aug 2025 02:19:15 GMT</pubDate>
    <dc:creator>AMur</dc:creator>
    <dc:date>2025-08-21T02:19:15Z</dc:date>
    <item>
      <title>pulldata @layer for rasters</title>
      <link>https://community.esri.com/t5/arcgis-survey123-questions/pulldata-layer-for-rasters/m-p/1644084#M63879</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;In Survey123 I am trying to query a DEM raster layer from map lick or coordinates with pulldata&amp;nbsp;@layer but cannot find how to read the stretch.pixel value. Under the layer's service page, Fields is &lt;EM&gt;None&amp;nbsp;&lt;/EM&gt;so not sure what to put in for "attributes"&lt;/P&gt;</description>
      <pubDate>Thu, 21 Aug 2025 02:19:15 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-survey123-questions/pulldata-layer-for-rasters/m-p/1644084#M63879</guid>
      <dc:creator>AMur</dc:creator>
      <dc:date>2025-08-21T02:19:15Z</dc:date>
    </item>
    <item>
      <title>Re: pulldata @layer for rasters</title>
      <link>https://community.esri.com/t5/arcgis-survey123-questions/pulldata-layer-for-rasters/m-p/1644146#M63883</link>
      <description>&lt;P&gt;Survey123 pulldata(@"layer" is for feature layers, feature tables or query enabled map services.&lt;/P&gt;&lt;P&gt;&lt;A href="https://doc.arcgis.com/en/survey123/desktop/create-surveys/xlsformformulas.htm#ESRI_SECTION1_BB97985CAFB740EE8AEF99EFD6E238E3" target="_blank"&gt;https://doc.arcgis.com/en/survey123/desktop/create-surveys/xlsformformulas.htm#ESRI_SECTION1_BB97985CAFB740EE8AEF99EFD6E238E3&lt;/A&gt;&lt;/P&gt;&lt;P&gt;You may be able to achieve this with JavaScript e.g. here's a starting point:&lt;/P&gt;&lt;P&gt;&lt;A href="https://community.esri.com/t5/arcgis-survey123-questions/survey123-javascript-extension-identify-pixel/td-p/779967" target="_blank"&gt;https://community.esri.com/t5/arcgis-survey123-questions/survey123-javascript-extension-identify-pixel/td-p/779967&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 21 Aug 2025 08:15:58 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-survey123-questions/pulldata-layer-for-rasters/m-p/1644146#M63883</guid>
      <dc:creator>ChristopherCounsell</dc:creator>
      <dc:date>2025-08-21T08:15:58Z</dc:date>
    </item>
    <item>
      <title>Re: pulldata @layer for rasters</title>
      <link>https://community.esri.com/t5/arcgis-survey123-questions/pulldata-layer-for-rasters/m-p/1644215#M63886</link>
      <description>&lt;P&gt;How big is your area of interest and what level of detail do you need the results?&amp;nbsp; I know DEMs are large when converted to vector even larger, but if you had a small are of interest and could generalize the DEM a bit, you could convert it to a polygon layer and the use the point in polygon pulldata method.&lt;/P&gt;</description>
      <pubDate>Thu, 21 Aug 2025 13:00:47 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-survey123-questions/pulldata-layer-for-rasters/m-p/1644215#M63886</guid>
      <dc:creator>Neal_t_k</dc:creator>
      <dc:date>2025-08-21T13:00:47Z</dc:date>
    </item>
    <item>
      <title>Re: pulldata @layer for rasters</title>
      <link>https://community.esri.com/t5/arcgis-survey123-questions/pulldata-layer-for-rasters/m-p/1645048#M63924</link>
      <description>&lt;P&gt;I have tried to use javascript to perform the action but am running in to issues with the returned json. I am connected through an Enterprise account but if I use the parent url the below script returns the error 'Token Required'. The error in Survey123 is always the same. I can use a child layer and paste the identify url in a browser but it will only return the layer attributes, never the value of the coordinates.&lt;/P&gt;&lt;P&gt;This script creates the following url (I have removed the url and lat/lon info)&lt;/P&gt;&lt;P data-unlink="true"&gt;&lt;STRONG&gt;&amp;lt;url&amp;gt;&lt;/STRONG&gt;/identify?geometry=%7B"x"%3A&lt;STRONG&gt;&amp;lt;lon&amp;gt;&lt;/STRONG&gt;%2C"y"%3A&lt;STRONG&gt;&amp;lt;lat&amp;gt;&lt;/STRONG&gt;%2C"spatialReference"%3A%7B"wkid"%3A4326%7D%7D&amp;amp;geometryType=esriGeometryPoint&amp;amp;returnGeometry=false&amp;amp;returnCatalogItems=false&amp;amp;f=json&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;BLOCKQUOTE&gt;&lt;P&gt;// rasterPixelValue.js&lt;/P&gt;&lt;P&gt;// Call from XLSForm: pulldata("@javascript", "rasterPixelValue.js", "getRasterValue", imageServiceUrl, longitude, latitude)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;function getRasterValue(imageServiceUrl, longitude, latitude) {&lt;/P&gt;&lt;P&gt;// Validate inputs&lt;/P&gt;&lt;P&gt;if (!imageServiceUrl || !longitude || !latitude) {&lt;/P&gt;&lt;P&gt;return "Error: Missing required parameters (imageServiceUrl, longitude, latitude)";&lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;// Convert coordinates to numbers&lt;/P&gt;&lt;P&gt;const lon = parseFloat(longitude);&lt;/P&gt;&lt;P&gt;const lat = parseFloat(latitude);&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;if (isNaN(lon) || isNaN(lat)) {&lt;/P&gt;&lt;P&gt;return "Error: Invalid coordinates";&lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;try {&lt;/P&gt;&lt;P&gt;// Build the identify request URL&lt;/P&gt;&lt;P&gt;const identifyUrl = imageServiceUrl.endsWith('/')&lt;/P&gt;&lt;P&gt;? imageServiceUrl + 'identify'&lt;/P&gt;&lt;P&gt;: imageServiceUrl + '/identify';&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;// Create the geometry parameter&lt;/P&gt;&lt;P&gt;const geometry = JSON.stringify({&lt;/P&gt;&lt;P&gt;x: lon,&lt;/P&gt;&lt;P&gt;y: lat,&lt;/P&gt;&lt;P&gt;spatialReference: { wkid: 4326 }&lt;/P&gt;&lt;P&gt;});&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;// Build request parameters manually&lt;/P&gt;&lt;P&gt;const params = [&lt;/P&gt;&lt;P&gt;'geometry=' + encodeURIComponent(geometry),&lt;/P&gt;&lt;P&gt;'geometryType=esriGeometryPoint',&lt;/P&gt;&lt;P&gt;'returnGeometry=false',&lt;/P&gt;&lt;P&gt;'returnCatalogItems=false',&lt;/P&gt;&lt;P&gt;'f=json'&lt;/P&gt;&lt;P&gt;];&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;const requestUrl = identifyUrl + '?' + params.join('&amp;amp;');&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;// Make synchronous request (required for Survey123 pulldata functions)&lt;/P&gt;&lt;P&gt;const xhr = new XMLHttpRequest();&lt;/P&gt;&lt;P&gt;xhr.open('GET', requestUrl, false); // false = synchronous&lt;/P&gt;&lt;P&gt;xhr.withCredentials = true;&lt;/P&gt;&lt;P&gt;xhr.send();&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;if (xhr.status === 200) {&lt;/P&gt;&lt;P&gt;const response = JSON.parse(xhr.responseText);&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;// Check for errors in response&lt;/P&gt;&lt;P&gt;if (response.error) {&lt;/P&gt;&lt;P&gt;return "Error: " + response.error.message + " " +requestUrl;&lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;// Extract pixel value&lt;/P&gt;&lt;P&gt;let pixelValue = null;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;if (response.value !== undefined &amp;amp;&amp;amp; response.value !== null) {&lt;/P&gt;&lt;P&gt;pixelValue = response.value;&lt;/P&gt;&lt;P&gt;} else if (response.values &amp;amp;&amp;amp; response.values.length &amp;gt; 0) {&lt;/P&gt;&lt;P&gt;// For multi-band rasters, return first band or comma-separated values&lt;/P&gt;&lt;P&gt;pixelValue = response.values.length === 1 ? response.values[0] : response.values.join(',');&lt;/P&gt;&lt;P&gt;} else if (response.properties &amp;amp;&amp;amp; Object.keys(response.properties).length &amp;gt; 0) {&lt;/P&gt;&lt;P&gt;// Sometimes pixel data is in properties&lt;/P&gt;&lt;P&gt;const keys = Object.keys(response.properties);&lt;/P&gt;&lt;P&gt;pixelValue = response.properties[keys[0]]; // Return first property value&lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;// Return the pixel value or "No Data" if null/undefined&lt;/P&gt;&lt;P&gt;return pixelValue !== null &amp;amp;&amp;amp; pixelValue !== undefined ? pixelValue.toString() : "No Data";&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;} else {&lt;/P&gt;&lt;P&gt;return "Error: HTTP " + xhr.status + " - Unable to query image service";&lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;} catch (error) {&lt;/P&gt;&lt;P&gt;return "Error: " + error.message;&lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 24 Aug 2025 22:57:57 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-survey123-questions/pulldata-layer-for-rasters/m-p/1645048#M63924</guid>
      <dc:creator>AMur</dc:creator>
      <dc:date>2025-08-24T22:57:57Z</dc:date>
    </item>
  </channel>
</rss>

