<?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: Using If...Then Statements from Attributes in ArcGIS JavaScript Maps SDK Questions</title>
    <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/using-if-then-statements-from-attributes/m-p/71165#M6322</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;if floor = "1" then [run function that shows floor one], else if floor = "2" [run function that shows floor two] and so on&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Ben,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Just a small comment. Rather than having a separate function for each floor, a potentially more robust and scalable method would be:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;
function showFloor(floor_number) {
&amp;nbsp; //run code to show floor = floor_number
}
&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Cheers,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Steve&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 10 Dec 2021 22:44:43 GMT</pubDate>
    <dc:creator>StephenLead</dc:creator>
    <dc:date>2021-12-10T22:44:43Z</dc:date>
    <item>
      <title>Using If...Then Statements from Attributes</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/using-if-then-statements-from-attributes/m-p/71163#M6320</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Is there a way to have Javascript's If/Then statements work from a polygon's attributes? I was just wondering since it would be a great way to add functionality to a web application. I'm developing a building floor plan map, and would like the search function to be able to automatically switch to a room's given floor automatically. Something like (this is just a rough idea) if floor = "1" then [run function that shows floor one], else if floor = "2" [run function that shows floor two] and so on. Has anybody tried this or had any luck using this (or a similar) method?&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 20 Sep 2011 15:54:40 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/using-if-then-statements-from-attributes/m-p/71163#M6320</guid>
      <dc:creator>BenReilly</dc:creator>
      <dc:date>2011-09-20T15:54:40Z</dc:date>
    </item>
    <item>
      <title>Re: Using If...Then Statements from Attributes</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/using-if-then-statements-from-attributes/m-p/71164#M6321</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Yes. I would see this as allowing someone to search via a text box or drop down list. When the search runs (a "search" button is clicked or the value of the drop down changes), the app hits a layer in a map service via a &lt;/SPAN&gt;&lt;A href="http://help.arcgis.com/en/webapi/javascript/arcgis/help/jsapi/querytask.htm"&gt;queryTask&lt;/A&gt;&lt;SPAN&gt;. Once the queryTask returns results, you loop through them and then use an if/then or switch statement to do something.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 20 Sep 2011 16:47:57 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/using-if-then-statements-from-attributes/m-p/71164#M6321</guid>
      <dc:creator>derekswingley1</dc:creator>
      <dc:date>2011-09-20T16:47:57Z</dc:date>
    </item>
    <item>
      <title>Re: Using If...Then Statements from Attributes</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/using-if-then-statements-from-attributes/m-p/71165#M6322</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;if floor = "1" then [run function that shows floor one], else if floor = "2" [run function that shows floor two] and so on&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Ben,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Just a small comment. Rather than having a separate function for each floor, a potentially more robust and scalable method would be:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;
function showFloor(floor_number) {
&amp;nbsp; //run code to show floor = floor_number
}
&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Cheers,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Steve&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 10 Dec 2021 22:44:43 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/using-if-then-statements-from-attributes/m-p/71165#M6322</guid>
      <dc:creator>StephenLead</dc:creator>
      <dc:date>2021-12-10T22:44:43Z</dc:date>
    </item>
  </channel>
</rss>

