<?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: How to pass search query into ArcGIS Online url? in ArcGIS Web AppBuilder Questions</title>
    <link>https://community.esri.com/t5/arcgis-web-appbuilder-questions/how-to-pass-search-query-into-arcgis-online-url/m-p/327676#M8644</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Jason,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; Why are you using a space between the lat and lon? The documentation states use a comma or semicolon:&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;&lt;BLOCKQUOTE&gt;&lt;TABLE border="1"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;You can use commas or semicolons as separators. Use semicolons if your numbers use colons as their decimals.&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;/BLOCKQUOTE&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;A href="http://doc.arcgis.com/en/web-appbuilder/manage-apps/app-url-parameters.htm#ESRI_SECTION1_3F3ECFBE570E406E9020F257A0D25064" title="http://doc.arcgis.com/en/web-appbuilder/manage-apps/app-url-parameters.htm#ESRI_SECTION1_3F3ECFBE570E406E9020F257A0D25064"&gt;Use URL parameters—Web AppBuilder for ArcGIS | ArcGIS&lt;/A&gt; &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 21 Apr 2016 02:01:18 GMT</pubDate>
    <dc:creator>RobertScheitlin__GISP</dc:creator>
    <dc:date>2016-04-21T02:01:18Z</dc:date>
    <item>
      <title>How to pass search query into ArcGIS Online url?</title>
      <link>https://community.esri.com/t5/arcgis-web-appbuilder-questions/how-to-pass-search-query-into-arcgis-online-url/m-p/327672#M8640</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello I am attempting to add a form to an existing html that allows the user to type in a search term and query and existing ArcGIS Online map. For example, a person would enter a coordinate into the form such as:&lt;/P&gt;&lt;P&gt;&amp;nbsp; &lt;IMG alt="submitCapture.PNG" class="image-1 jive-image" src="https://community.esri.com/legacyfs/online/195176_submitCapture.PNG" style="height: auto;" /&gt;&lt;/P&gt;&lt;P&gt;The resulting url should be (unencoded) : &lt;A href="http://www.arcgis.com/apps/webappviewer/index.html?find=-112.111"&gt;www.arcgis.com/apps/webappviewer/index.html?find=-112.111&lt;/A&gt; 33.3456&lt;/P&gt;&lt;P&gt;encoded it should look like: &lt;A href="http://www.arcgis.com/apps/webappviewer/index.html?find=-112.111%2033.3456"&gt;www.arcgis.com/apps/webappviewer/index.html?find=-112.111%2033.3456&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The problem is that because the parameter (find) is after the "?" the whitespace in the url is encoded with a "+" instead of "%20". The url becomes: &lt;A href="http://www.arcgis.com/apps/webappviewer/index.html?find=-112.111+33.3456"&gt;www.arcgis.com/apps/webappviewer/index.html?find=-112.111+33.3456&lt;/A&gt;&lt;/P&gt;&lt;P&gt;This causes&amp;nbsp; the feature search to search for : &lt;IMG alt="searchCapture.PNG" class="image-2 jive-image" src="https://community.esri.com/legacyfs/online/195177_searchCapture.PNG" style="height: auto;" /&gt;which results in not finding the coordinate.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;My question is how can I get a url form to pass the search query either unencoded, or having the whitespace encoded as "%20" instead of "+"? I am using the get method and have tried having a javascript function replace the whitespace with "%20", but the % symbol gets encoded. Any suggestions would be greatly appreciated!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;-Jason&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 20 Apr 2016 21:48:31 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-web-appbuilder-questions/how-to-pass-search-query-into-arcgis-online-url/m-p/327672#M8640</guid>
      <dc:creator>jasonramsey1</dc:creator>
      <dc:date>2016-04-20T21:48:31Z</dc:date>
    </item>
    <item>
      <title>Re: How to pass search query into ArcGIS Online url?</title>
      <link>https://community.esri.com/t5/arcgis-web-appbuilder-questions/how-to-pass-search-query-into-arcgis-online-url/m-p/327673#M8641</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Jason, &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Could you just replace the search input content with JavaScript, after the page has been loaded?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;document.getElementById("search_input").value = document.getElementById("search_input").value.replace("+", ", ")&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 20 Apr 2016 22:20:11 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-web-appbuilder-questions/how-to-pass-search-query-into-arcgis-online-url/m-p/327673#M8641</guid>
      <dc:creator>BillGrow</dc:creator>
      <dc:date>2016-04-20T22:20:11Z</dc:date>
    </item>
    <item>
      <title>Re: How to pass search query into ArcGIS Online url?</title>
      <link>https://community.esri.com/t5/arcgis-web-appbuilder-questions/how-to-pass-search-query-into-arcgis-online-url/m-p/327674#M8642</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Bill. Your response sounds promising, but I am not sure how to go about doing that. Would the JavaScript be in the original html that contains the form? Or would the replacement function somehow be passed in the url? I am pretty novice when it comes to javascript and the HTML. Any direction/guidance would be appreciated! &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 20 Apr 2016 23:14:50 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-web-appbuilder-questions/how-to-pass-search-query-into-arcgis-online-url/m-p/327674#M8642</guid>
      <dc:creator>jasonramsey1</dc:creator>
      <dc:date>2016-04-20T23:14:50Z</dc:date>
    </item>
    <item>
      <title>Re: How to pass search query into ArcGIS Online url?</title>
      <link>https://community.esri.com/t5/arcgis-web-appbuilder-questions/how-to-pass-search-query-into-arcgis-online-url/m-p/327675#M8643</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;If you're using WAB Developer edition, you can use the &lt;STRONG&gt;. replace(a, b)&lt;/STRONG&gt; method in the Find widget JavaScript code (After it parses the URL params). &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If, however, you don't have access to the code (arcgis.com), and are passing the data from another form, you'll probably want to encode the URI before sending, and submit the form using JavaScript.&amp;nbsp; Something like:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;var findParam = document.getElementById("lat-lon-input-field").value&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;SPAN&gt;var rootAppURL = "&lt;/SPAN&gt;&lt;A class="jive-link-external-small" href="https://community.esri.com/external-link.jspa?url=https%3A%2F%2Fmyapp.com%2Fapp" rel="nofollow" target="_blank"&gt;https://myapp.com/app&lt;/A&gt;&lt;SPAN&gt;"&lt;/SPAN&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;encodedURL = encodeURI( rootAppURL + "?find=" + findParam)&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;window.location = encodedURL&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hopefully one of those methods answers your original question.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Ref: &lt;A href="http://www.w3schools.com/jsref/jsref_encodeURI.asp" title="http://www.w3schools.com/jsref/jsref_encodeURI.asp"&gt;http://www.w3schools.com/jsref/jsref_encodeURI.asp&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*There are cleaner ways to write this code, but that should get you started.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 21 Apr 2016 00:28:03 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-web-appbuilder-questions/how-to-pass-search-query-into-arcgis-online-url/m-p/327675#M8643</guid>
      <dc:creator>BillGrow</dc:creator>
      <dc:date>2016-04-21T00:28:03Z</dc:date>
    </item>
    <item>
      <title>Re: How to pass search query into ArcGIS Online url?</title>
      <link>https://community.esri.com/t5/arcgis-web-appbuilder-questions/how-to-pass-search-query-into-arcgis-online-url/m-p/327676#M8644</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Jason,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; Why are you using a space between the lat and lon? The documentation states use a comma or semicolon:&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;&lt;BLOCKQUOTE&gt;&lt;TABLE border="1"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;You can use commas or semicolons as separators. Use semicolons if your numbers use colons as their decimals.&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;/BLOCKQUOTE&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;A href="http://doc.arcgis.com/en/web-appbuilder/manage-apps/app-url-parameters.htm#ESRI_SECTION1_3F3ECFBE570E406E9020F257A0D25064" title="http://doc.arcgis.com/en/web-appbuilder/manage-apps/app-url-parameters.htm#ESRI_SECTION1_3F3ECFBE570E406E9020F257A0D25064"&gt;Use URL parameters—Web AppBuilder for ArcGIS | ArcGIS&lt;/A&gt; &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 21 Apr 2016 02:01:18 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-web-appbuilder-questions/how-to-pass-search-query-into-arcgis-online-url/m-p/327676#M8644</guid>
      <dc:creator>RobertScheitlin__GISP</dc:creator>
      <dc:date>2016-04-21T02:01:18Z</dc:date>
    </item>
    <item>
      <title>Re: How to pass search query into ArcGIS Online url?</title>
      <link>https://community.esri.com/t5/arcgis-web-appbuilder-questions/how-to-pass-search-query-into-arcgis-online-url/m-p/327677#M8645</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks Robert for the input on the spaces. Spaces are accepted and that is the way that non-GIS personnel are used to. In addition, spaces are needed to enter an address in to the HTML form which is then passed incorrectly into the query string of the URL. Basically, if the attribute that is needed to be entered into the URL after the ?find= has a space in it then it will fail to find the feature with the + symbol substituted for the space.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Jason&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 21 Apr 2016 02:12:29 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-web-appbuilder-questions/how-to-pass-search-query-into-arcgis-online-url/m-p/327677#M8645</guid>
      <dc:creator>jasonramsey1</dc:creator>
      <dc:date>2016-04-21T02:12:29Z</dc:date>
    </item>
    <item>
      <title>Re: How to pass search query into ArcGIS Online url?</title>
      <link>https://community.esri.com/t5/arcgis-web-appbuilder-questions/how-to-pass-search-query-into-arcgis-online-url/m-p/327678#M8646</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Jason,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; I am really confused where the plus is coming from. The substituting of a space with a plus is not a normal encoding method that I am aware of. What does your from html and or JS look like?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 21 Apr 2016 02:18:12 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-web-appbuilder-questions/how-to-pass-search-query-into-arcgis-online-url/m-p/327678#M8646</guid>
      <dc:creator>RobertScheitlin__GISP</dc:creator>
      <dc:date>2016-04-21T02:18:12Z</dc:date>
    </item>
    <item>
      <title>Re: How to pass search query into ArcGIS Online url?</title>
      <link>https://community.esri.com/t5/arcgis-web-appbuilder-questions/how-to-pass-search-query-into-arcgis-online-url/m-p/327679#M8647</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You could also use my code above, to clean up user input before sending it correctly on to the application; as long as you don’t need to do any server side stuff.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="http://www.w3schools.com/js/js_string_methods.asp" title="http://www.w3schools.com/js/js_string_methods.asp"&gt;JavaScript String Methods&lt;/A&gt; &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 21 Apr 2016 02:18:48 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-web-appbuilder-questions/how-to-pass-search-query-into-arcgis-online-url/m-p/327679#M8647</guid>
      <dc:creator>BillGrow</dc:creator>
      <dc:date>2016-04-21T02:18:48Z</dc:date>
    </item>
    <item>
      <title>Re: How to pass search query into ArcGIS Online url?</title>
      <link>https://community.esri.com/t5/arcgis-web-appbuilder-questions/how-to-pass-search-query-into-arcgis-online-url/m-p/327680#M8648</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks Bill. I definitely will experiment with your code tomorrow when I am back at work.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Jason&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 21 Apr 2016 02:29:17 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-web-appbuilder-questions/how-to-pass-search-query-into-arcgis-online-url/m-p/327680#M8648</guid>
      <dc:creator>jasonramsey1</dc:creator>
      <dc:date>2016-04-21T02:29:17Z</dc:date>
    </item>
    <item>
      <title>Re: How to pass search query into ArcGIS Online url?</title>
      <link>https://community.esri.com/t5/arcgis-web-appbuilder-questions/how-to-pass-search-query-into-arcgis-online-url/m-p/327681#M8649</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Robert,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The plus is normal encoding in the query string (?)when using the "get" method in an HTML form.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Jason&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 21 Apr 2016 02:34:41 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-web-appbuilder-questions/how-to-pass-search-query-into-arcgis-online-url/m-p/327681#M8649</guid>
      <dc:creator>jasonramsey1</dc:creator>
      <dc:date>2016-04-21T02:34:41Z</dc:date>
    </item>
    <item>
      <title>Re: How to pass search query into ArcGIS Online url?</title>
      <link>https://community.esri.com/t5/arcgis-web-appbuilder-questions/how-to-pass-search-query-into-arcgis-online-url/m-p/327682#M8650</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks Bill and Robert for your input so far. The following code almost works, but it somehow includes the file path to the html in the url passed to window.open. I am not sure what I need to do to correct it.&lt;/P&gt;&lt;P&gt;&amp;lt;!DOCTYPE html&amp;gt;&lt;/P&gt;&lt;P&gt;&amp;lt;html&amp;gt;&lt;/P&gt;&lt;P&gt;&amp;lt;head&amp;gt;&lt;/P&gt;&lt;P&gt;&amp;lt;script type="text/javascript"&amp;gt;&lt;/P&gt;&lt;P&gt;function getURL(val){&lt;/P&gt;&lt;P&gt;base = 'www.arcgis.com/apps/webappviewer/index.html?find=';&lt;/P&gt;&lt;P&gt;uri=base +val;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; //location2 = encodeURI(uri);&lt;/P&gt;&lt;P&gt;window.open(uri);&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;P&gt;&amp;lt;/script&amp;gt;&lt;/P&gt;&lt;P&gt;&amp;lt;/head&amp;gt;&lt;/P&gt;&lt;P&gt;&amp;lt;body&amp;gt;&lt;/P&gt;&lt;P&gt;&amp;lt;form&amp;nbsp; id="form1" name="form1" method="get" onsubmit="getURL(form1.find.value)" &amp;gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;lt;label&amp;gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;lt;input type="text" name="find" /&amp;gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;lt;/label&amp;gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;lt;label&amp;gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;lt;input type="submit" /&amp;gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;lt;/label&amp;gt;&lt;/P&gt;&lt;P&gt;&amp;lt;/form&amp;gt;&lt;/P&gt;&lt;P&gt;&amp;lt;/body&amp;gt;&lt;/P&gt;&lt;P&gt;&amp;lt;/html&amp;gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;so if somebody enters 1616 W. Adams, Phoenix, AZ into the form, the url becomes:&lt;/P&gt;&lt;P&gt;file:///W:/GIS_Scratch/www.arcgis.com/apps/webappviewer/index.html?find=1616%20W.%20Adams,%20Phoenix,%20AZ&lt;/P&gt;&lt;P&gt;instead of: &lt;A href="http://www.arcgis.com/apps/webappviewer/index.html?find=1616%20W.%20Adams,%20Phoenix,%20AZ"&gt;www.arcgis.com/apps/webappviewer/index.html?find=1616%20W.%20Adams,%20Phoenix,%20AZ&lt;BR /&gt;&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am not sure what I need to do to correct it.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 21 Apr 2016 18:59:24 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-web-appbuilder-questions/how-to-pass-search-query-into-arcgis-online-url/m-p/327682#M8650</guid>
      <dc:creator>jasonramsey1</dc:creator>
      <dc:date>2016-04-21T18:59:24Z</dc:date>
    </item>
    <item>
      <title>Re: How to pass search query into ArcGIS Online url?</title>
      <link>https://community.esri.com/t5/arcgis-web-appbuilder-questions/how-to-pass-search-query-into-arcgis-online-url/m-p/327683#M8651</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Jason,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&amp;nbsp; You just need to add &lt;/SPAN&gt;&lt;A class="jive-link-external-small" href="https://community.esri.com/external-link.jspa?url=http%3A%2F%2F" rel="nofollow" target="_blank"&gt;http://&lt;/A&gt;&lt;SPAN&gt; to the uri.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;base = '&lt;/SPAN&gt;&lt;A class="jive-link-external-small" href="https://community.esri.com/external-link.jspa?url=http%3A%2F%2Fwww.arcgis.com%2Fapps%2Fwebappviewer%2Findex.html%3Ffind%3D%27%3B" rel="nofollow" target="_blank"&gt;http://www.arcgis.com/apps/webappviewer/index.html?find=';&lt;/A&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 21 Apr 2016 19:43:41 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-web-appbuilder-questions/how-to-pass-search-query-into-arcgis-online-url/m-p/327683#M8651</guid>
      <dc:creator>RobertScheitlin__GISP</dc:creator>
      <dc:date>2016-04-21T19:43:41Z</dc:date>
    </item>
  </channel>
</rss>

