<?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: Pulldata using @javascript does not work on web form (Query the record with an attribute value) in ArcGIS Survey123 Questions</title>
    <link>https://community.esri.com/t5/arcgis-survey123-questions/pulldata-using-javascript-does-not-work-on-web/m-p/1051614#M34165</link>
    <description>&lt;P&gt;Hello,&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'd like to provide more information what I have been today, but it still does not work.&lt;/P&gt;&lt;P&gt;I used a query page to get the accurate url pattern that I'd like to apply. I noticed that there was '+' for space, so I applied that in the url scheme in the Javascript file.&lt;/P&gt;&lt;P&gt;After I fixed, it will look like this (Project_Name = 'Sample Project-Phase1'). To confirm, I coped and pasted the url in the browser, and I could see the json return, just like shown in my mobile app and Connect.&amp;nbsp; However, it still shows nothing in the webform.&lt;/P&gt;&lt;P&gt;&lt;A href="https://services1.arcgis.com/../FeatureServer/0/query?where=Project_Name+%3D+%27Sample+Project-Phase1%27&amp;amp;outFields=*&amp;amp;returnGeometry=false&amp;amp;&amp;amp;f=pjson&amp;amp;token=" target="_blank" rel="noopener"&gt;https://services1.arcgis.com/../FeatureServer/0/query?where=Project_Name+%3D+%27Sample+Project-Phase1%27&amp;amp;outFields=*&amp;amp;returnGeometry=false&amp;amp;&amp;amp;f=pjson&amp;amp;token=&lt;/A&gt;&lt;/P&gt;&lt;P&gt;Should I pass x, y to get the json return in web form like the featureByLocation code sample in the Connect? I am still not clear what makes different in my javascript pulldata.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;When I checked the development tool, it shows the error below. Does it indicate the error that I have,,?&lt;/P&gt;&lt;P&gt;"DevTools failed to load SourceMap: Could not load content for chrome-extension://.../sourceMap/chrome/content.map: HTTP error: status code 404, net::ERR_UNKNOWN_URL_SCHEME"&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="KerryKang_0-1619500333295.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/11911i2AF3424B85468280/image-size/medium?v=v2&amp;amp;px=400" role="button" title="KerryKang_0-1619500333295.png" alt="KerryKang_0-1619500333295.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Tue, 27 Apr 2021 05:18:52 GMT</pubDate>
    <dc:creator>KerryKang</dc:creator>
    <dc:date>2021-04-27T05:18:52Z</dc:date>
    <item>
      <title>Pulldata using @javascript does not work on web form (Query the record with an attribute value)</title>
      <link>https://community.esri.com/t5/arcgis-survey123-questions/pulldata-using-javascript-does-not-work-on-web/m-p/1051003#M34138</link>
      <description>&lt;P&gt;Hello Esri Survey123 team, &lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/1213"&gt;@JamesTedrick&lt;/a&gt;&amp;nbsp;,&amp;nbsp;@Anonymous User&amp;nbsp; or &lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/2929"&gt;@IsmaelChivite&lt;/a&gt;&amp;nbsp;could you please help me,,,?&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am creating a web form that will use the pulldata function to retrieve the attributes from another feature layer.&lt;/P&gt;&lt;P&gt;This is how I'd like to set up.&lt;/P&gt;&lt;P&gt;- Survey1 is used to create a project list and its detail information such as year, client, and team members.&lt;/P&gt;&lt;P&gt;- Survey2 is used to track hours per each project created in Survey1. I hope to use 'dynamic dropdown' for the project list but I am aware that it's not implemented yet. So the project list is coming from another CSV table hosted on AGOL.&lt;/P&gt;&lt;P&gt;- In Survey2, when user select a project name, the project name will be used to query the attributes in Survey1 feature layer, and pullout its relevant information. This will be done using pulldata javascript as it will access the feature layer directly which will be consistently updated by managers rather than using pulldata csv.&lt;/P&gt;&lt;P&gt;To do that,&amp;nbsp;I created a JavaScript functions that query the record with 'where clause' only (not using x, y location), and I am supposed to get the attributes in json. It worked perfect when I tested in Connect and Survey123 app on mobile device, but in web form I can confirm that json result area is empty where I used pulldata @javascript, and therefore &lt;A href="mailto:pulldata@json" target="_blank" rel="noopener"&gt;pulldata@json &lt;/A&gt;questions that I am using to get each attribute value are empty, too.&lt;/P&gt;&lt;P&gt;When I tested using with 'featureByLocation' from the sample form, it worked fine on the web form. So I am not sure why my function does not work on web form, assuming that something must be wrong with my code. I used something that may not recognized by web browser??&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The images below show the reusult of my javascript request in the mobile app vs. web browser.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;pulldata("@javascript", "getProjectDetail.js", "featureByAttribute", ${Project_Name}, ${Token}))&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;Result in the mobile app&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="KerryKang_0-1619238838792.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/11747i70F2E60CB8B32591/image-size/medium?v=v2&amp;amp;px=400" role="button" title="KerryKang_0-1619238838792.png" alt="KerryKang_0-1619238838792.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Result in the web form (empty)&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="KerryKang_1-1619238871586.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/11748i08DBE6755334D252/image-size/medium?v=v2&amp;amp;px=400" role="button" title="KerryKang_1-1619238871586.png" alt="KerryKang_1-1619238871586.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This is what I did for scripting,.. sorry for poor coding. I hope to get some advice.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;function featureByAttribute(projectName, token) {&lt;BR /&gt;// Output value. Initially set to an empty string (XLSForm null)&lt;BR /&gt;let outValue = "";&lt;/P&gt;&lt;P&gt;// Check to make sure both layerURL and location are provided&lt;BR /&gt;if (projectName == null || projectName == "") {&lt;BR /&gt;// The function can't go forward; exit with the empty value&lt;BR /&gt;return projectName;&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;// I used these variables to replace '=' and ''' in url&lt;BR /&gt;let newEqual = "%3D"&lt;BR /&gt;let sgQuote = "%27"&lt;BR /&gt;&lt;BR /&gt;// Set up query parameters&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;let parameter1 = "where=Project_Name"&lt;BR /&gt;let parameter2 = [parameter1, newEqual,sgQuote,projectName,sgQuote].join('')&lt;BR /&gt;let parameter3 = "f=pjson&amp;amp;outFields=*&amp;amp;returnGeometry=false"&lt;BR /&gt;let parameters = [parameter2, parameter3].join("&amp;amp;");&lt;BR /&gt;let layerURL = '&lt;A href="https://services1.arcgis.com/..../FeatureServer/0" target="_blank" rel="noopener"&gt;https://services1.arcgis.com/..../FeatureServer/0&lt;/A&gt;'&lt;BR /&gt;&lt;BR /&gt;if (token) {&lt;BR /&gt;&lt;BR /&gt;parameters = parameters + `&amp;amp;token=${token}`;&lt;/P&gt;&lt;P&gt;}&lt;BR /&gt;&lt;BR /&gt;let url = `${layerURL}/query?${parameters}`;&lt;/P&gt;</description>
      <pubDate>Tue, 27 Apr 2021 05:18:06 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-survey123-questions/pulldata-using-javascript-does-not-work-on-web/m-p/1051003#M34138</guid>
      <dc:creator>KerryKang</dc:creator>
      <dc:date>2021-04-27T05:18:06Z</dc:date>
    </item>
    <item>
      <title>Re: Pulldata using @javascript does not work on web form (Query the record with an attribute value)</title>
      <link>https://community.esri.com/t5/arcgis-survey123-questions/pulldata-using-javascript-does-not-work-on-web/m-p/1051614#M34165</link>
      <description>&lt;P&gt;Hello,&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'd like to provide more information what I have been today, but it still does not work.&lt;/P&gt;&lt;P&gt;I used a query page to get the accurate url pattern that I'd like to apply. I noticed that there was '+' for space, so I applied that in the url scheme in the Javascript file.&lt;/P&gt;&lt;P&gt;After I fixed, it will look like this (Project_Name = 'Sample Project-Phase1'). To confirm, I coped and pasted the url in the browser, and I could see the json return, just like shown in my mobile app and Connect.&amp;nbsp; However, it still shows nothing in the webform.&lt;/P&gt;&lt;P&gt;&lt;A href="https://services1.arcgis.com/../FeatureServer/0/query?where=Project_Name+%3D+%27Sample+Project-Phase1%27&amp;amp;outFields=*&amp;amp;returnGeometry=false&amp;amp;&amp;amp;f=pjson&amp;amp;token=" target="_blank" rel="noopener"&gt;https://services1.arcgis.com/../FeatureServer/0/query?where=Project_Name+%3D+%27Sample+Project-Phase1%27&amp;amp;outFields=*&amp;amp;returnGeometry=false&amp;amp;&amp;amp;f=pjson&amp;amp;token=&lt;/A&gt;&lt;/P&gt;&lt;P&gt;Should I pass x, y to get the json return in web form like the featureByLocation code sample in the Connect? I am still not clear what makes different in my javascript pulldata.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;When I checked the development tool, it shows the error below. Does it indicate the error that I have,,?&lt;/P&gt;&lt;P&gt;"DevTools failed to load SourceMap: Could not load content for chrome-extension://.../sourceMap/chrome/content.map: HTTP error: status code 404, net::ERR_UNKNOWN_URL_SCHEME"&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="KerryKang_0-1619500333295.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/11911i2AF3424B85468280/image-size/medium?v=v2&amp;amp;px=400" role="button" title="KerryKang_0-1619500333295.png" alt="KerryKang_0-1619500333295.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 27 Apr 2021 05:18:52 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-survey123-questions/pulldata-using-javascript-does-not-work-on-web/m-p/1051614#M34165</guid>
      <dc:creator>KerryKang</dc:creator>
      <dc:date>2021-04-27T05:18:52Z</dc:date>
    </item>
    <item>
      <title>Re: Pulldata using @javascript does not work on web form (Query the record with an attribute value)</title>
      <link>https://community.esri.com/t5/arcgis-survey123-questions/pulldata-using-javascript-does-not-work-on-web/m-p/1139876#M40215</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/221172"&gt;@KerryKang&lt;/a&gt;,&amp;nbsp;did you ever figure this out? I'm trying to do something similar.&lt;/P&gt;&lt;P&gt;Thankyou,&amp;nbsp;&lt;/P&gt;&lt;P&gt;Heather.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 02 Feb 2022 15:46:02 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-survey123-questions/pulldata-using-javascript-does-not-work-on-web/m-p/1139876#M40215</guid>
      <dc:creator>HeatherBell</dc:creator>
      <dc:date>2022-02-02T15:46:02Z</dc:date>
    </item>
    <item>
      <title>Re: Pulldata using @javascript does not work on web form (Query the record with an attribute value)</title>
      <link>https://community.esri.com/t5/arcgis-survey123-questions/pulldata-using-javascript-does-not-work-on-web/m-p/1141127#M40327</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/221172"&gt;@KerryKang&lt;/a&gt;&amp;nbsp;,&amp;nbsp;&lt;/P&gt;&lt;P&gt;Please &lt;A href="https://community.esri.com/t5/arcgis-survey123-questions/pulldata-javascript-query-a-feature-layer-to/m-p/1141126#M40326" target="_self"&gt;see the solution in this post which will work on surveys that are shared at the organisational level&lt;/A&gt; but not publicly shared forms. There is a solution that will do this with &lt;A href="https://community.esri.com/t5/arcgis-survey123-questions/autpopulate-field-based-on-corresponding-attribute/m-p/1139751#M40205" target="_self"&gt;dynamic choice lists for forms that can be shared publicly here.&amp;nbsp;&lt;/A&gt;&amp;nbsp;I have submitted an idea for &lt;A href="https://community.esri.com/t5/arcgis-survey123-ideas/pre-populate-information-based-upon-user-selection/idi-p/1141125" target="_self"&gt;expanding the search function used in dynamic choice lists to do this for publicly shared forms for other field types- see here.&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Best wishes,&lt;/P&gt;</description>
      <pubDate>Mon, 07 Feb 2022 12:02:17 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-survey123-questions/pulldata-using-javascript-does-not-work-on-web/m-p/1141127#M40327</guid>
      <dc:creator>HeatherBell</dc:creator>
      <dc:date>2022-02-07T12:02:17Z</dc:date>
    </item>
  </channel>
</rss>

