<?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 If statements and pulldata(&amp;quot;@layer&amp;quot;) in ArcGIS Survey123 Questions</title>
    <link>https://community.esri.com/t5/arcgis-survey123-questions/if-statements-and-pulldata-quot-layer-quot/m-p/1233923#M46171</link>
    <description>&lt;P&gt;Noticing some weird behavior and hoping someone can shed some light on it. In a survey I'm working on, a map is chosen based on a drop down menu. This is working just fine.&lt;/P&gt;&lt;P&gt;I'm trying to geofence where people can place a pin in those maps. When I did the first map (with no if statement) it worked great. But now that I'm trying to do it with other maps, it seems to always default to the first item in the if statement. For example, in the code below, even if I choose "map2" and click somewhere, I will get the objectid of whatever is in the location in map1. Now, if I unselect map2 and select another map and then reselect map2 without clicking in the map, it will give me the correct answer - once - the next time I click, it again shows me the objectid from map1. Any ideas?&lt;/P&gt;&lt;P&gt;Example code:&lt;/P&gt;&lt;LI-CODE lang="c"&gt;if(${mapchoice}="map1", pulldata("@layer", "getValueAt", "attributes.OBJECTID", "https://urltomap1/FeatureServer/1", ${location_of_problem}), 
if(${mapchoice}="map2", pulldata("@layer", "getValueAt", "attributes.OBJECTID", "https://urltomap2/FeatureServer/1", ${location_of_problem}), 
0))&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Mon, 21 Nov 2022 21:14:40 GMT</pubDate>
    <dc:creator>RogerAsbury</dc:creator>
    <dc:date>2022-11-21T21:14:40Z</dc:date>
    <item>
      <title>If statements and pulldata("@layer")</title>
      <link>https://community.esri.com/t5/arcgis-survey123-questions/if-statements-and-pulldata-quot-layer-quot/m-p/1233923#M46171</link>
      <description>&lt;P&gt;Noticing some weird behavior and hoping someone can shed some light on it. In a survey I'm working on, a map is chosen based on a drop down menu. This is working just fine.&lt;/P&gt;&lt;P&gt;I'm trying to geofence where people can place a pin in those maps. When I did the first map (with no if statement) it worked great. But now that I'm trying to do it with other maps, it seems to always default to the first item in the if statement. For example, in the code below, even if I choose "map2" and click somewhere, I will get the objectid of whatever is in the location in map1. Now, if I unselect map2 and select another map and then reselect map2 without clicking in the map, it will give me the correct answer - once - the next time I click, it again shows me the objectid from map1. Any ideas?&lt;/P&gt;&lt;P&gt;Example code:&lt;/P&gt;&lt;LI-CODE lang="c"&gt;if(${mapchoice}="map1", pulldata("@layer", "getValueAt", "attributes.OBJECTID", "https://urltomap1/FeatureServer/1", ${location_of_problem}), 
if(${mapchoice}="map2", pulldata("@layer", "getValueAt", "attributes.OBJECTID", "https://urltomap2/FeatureServer/1", ${location_of_problem}), 
0))&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 21 Nov 2022 21:14:40 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-survey123-questions/if-statements-and-pulldata-quot-layer-quot/m-p/1233923#M46171</guid>
      <dc:creator>RogerAsbury</dc:creator>
      <dc:date>2022-11-21T21:14:40Z</dc:date>
    </item>
    <item>
      <title>Re: If statements and pulldata("@layer")</title>
      <link>https://community.esri.com/t5/arcgis-survey123-questions/if-statements-and-pulldata-quot-layer-quot/m-p/1233924#M46172</link>
      <description>&lt;P&gt;I think this was posted the other day.&amp;nbsp; You need to have pulldata in separate field then call that field in the if and it seems to go better.&amp;nbsp; Give that a shot.&lt;/P&gt;</description>
      <pubDate>Mon, 21 Nov 2022 21:19:52 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-survey123-questions/if-statements-and-pulldata-quot-layer-quot/m-p/1233924#M46172</guid>
      <dc:creator>DougBrowning</dc:creator>
      <dc:date>2022-11-21T21:19:52Z</dc:date>
    </item>
    <item>
      <title>Re: If statements and pulldata("@layer")</title>
      <link>https://community.esri.com/t5/arcgis-survey123-questions/if-statements-and-pulldata-quot-layer-quot/m-p/1233974#M46173</link>
      <description>&lt;P&gt;Thanks much! That worked perfectly. Sorry for missing the earlier question.&lt;/P&gt;</description>
      <pubDate>Tue, 22 Nov 2022 00:46:00 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-survey123-questions/if-statements-and-pulldata-quot-layer-quot/m-p/1233974#M46173</guid>
      <dc:creator>RogerAsbury</dc:creator>
      <dc:date>2022-11-22T00:46:00Z</dc:date>
    </item>
  </channel>
</rss>

