<?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: Arcade IIF statement not working in ArcGIS Field Maps Questions</title>
    <link>https://community.esri.com/t5/arcgis-field-maps-questions/arcade-iif-statement-not-working/m-p/1296643#M6227</link>
    <description>&lt;P&gt;You're correct in your thinking that it's a question of improperly evaluating a FeatureSet. You have to get a Feature from that FeatureSet to do that. If you're expecting only item to be in the FeatureSet, use &lt;A href="https://developers.arcgis.com/arcade/function-reference/featureset_functions/#first" target="_self"&gt;First&lt;/A&gt; to get that feature and perform your evaluation.&lt;/P&gt;&lt;LI-CODE lang="c"&gt;var fs = FeatureSetByRelationshipName($feature, 'WCC_Hort_Site_Auditing_XV2X_inspection_audit');
var feat = First(fs);
iif(feat['bedding']=='yes','yes','no');&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Wed, 07 Jun 2023 13:04:07 GMT</pubDate>
    <dc:creator>KenBuja</dc:creator>
    <dc:date>2023-06-07T13:04:07Z</dc:date>
    <item>
      <title>Arcade IIF statement not working</title>
      <link>https://community.esri.com/t5/arcgis-field-maps-questions/arcade-iif-statement-not-working/m-p/1296588#M6224</link>
      <description>&lt;P&gt;Hi there,&lt;/P&gt;&lt;P&gt;I am trying to use an IIF calculation to determine whether a switch should be selected to 'yes' or 'no' based on a field in the parent data.&lt;/P&gt;&lt;P&gt;When I use the following calculation:&lt;/P&gt;&lt;P&gt;Features = FeatureSetByRelationshipName($feature, 'WCC_Hort_Site_Auditing_XV2X_inspection_audit');&lt;/P&gt;&lt;P&gt;the result is&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="tendtreesTC_0-1686131981207.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/72521iD7099E04F8743667/image-size/medium?v=v2&amp;amp;px=400" role="button" title="tendtreesTC_0-1686131981207.png" alt="tendtreesTC_0-1686131981207.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;However, when I try to input this into an IIF statement:&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;iif&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;FeatureSetByRelationshipName&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;$feature&lt;/SPAN&gt;&lt;SPAN&gt;, &lt;/SPAN&gt;&lt;SPAN&gt;'WCC_Hort_Site_Auditing_XV2X_inspection_audit'&lt;/SPAN&gt;&lt;SPAN&gt;,[&lt;/SPAN&gt;&lt;SPAN&gt;'bedding'&lt;/SPAN&gt;&lt;SPAN&gt;])==&lt;/SPAN&gt;&lt;SPAN&gt;'yes'&lt;/SPAN&gt;&lt;SPAN&gt;,&lt;/SPAN&gt;&lt;SPAN&gt;'yes'&lt;/SPAN&gt;&lt;SPAN&gt;,&lt;/SPAN&gt;&lt;SPAN&gt;'no'&lt;/SPAN&gt;&lt;SPAN&gt;)&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;it returns "no"&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;I imagine it is something to do with the return being a featureSet rather than a straight yes/no&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;Can anyone help me with this calculation?&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;Thank you&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Wed, 07 Jun 2023 10:02:43 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-field-maps-questions/arcade-iif-statement-not-working/m-p/1296588#M6224</guid>
      <dc:creator>tendtreesTC</dc:creator>
      <dc:date>2023-06-07T10:02:43Z</dc:date>
    </item>
    <item>
      <title>Re: Arcade IIF statement not working</title>
      <link>https://community.esri.com/t5/arcgis-field-maps-questions/arcade-iif-statement-not-working/m-p/1296643#M6227</link>
      <description>&lt;P&gt;You're correct in your thinking that it's a question of improperly evaluating a FeatureSet. You have to get a Feature from that FeatureSet to do that. If you're expecting only item to be in the FeatureSet, use &lt;A href="https://developers.arcgis.com/arcade/function-reference/featureset_functions/#first" target="_self"&gt;First&lt;/A&gt; to get that feature and perform your evaluation.&lt;/P&gt;&lt;LI-CODE lang="c"&gt;var fs = FeatureSetByRelationshipName($feature, 'WCC_Hort_Site_Auditing_XV2X_inspection_audit');
var feat = First(fs);
iif(feat['bedding']=='yes','yes','no');&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 07 Jun 2023 13:04:07 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-field-maps-questions/arcade-iif-statement-not-working/m-p/1296643#M6227</guid>
      <dc:creator>KenBuja</dc:creator>
      <dc:date>2023-06-07T13:04:07Z</dc:date>
    </item>
    <item>
      <title>Re: Arcade IIF statement not working</title>
      <link>https://community.esri.com/t5/arcgis-field-maps-questions/arcade-iif-statement-not-working/m-p/1297023#M6258</link>
      <description>&lt;P&gt;that worked great thank you&lt;/P&gt;</description>
      <pubDate>Thu, 08 Jun 2023 09:21:52 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-field-maps-questions/arcade-iif-statement-not-working/m-p/1297023#M6258</guid>
      <dc:creator>tendtreesTC</dc:creator>
      <dc:date>2023-06-08T09:21:52Z</dc:date>
    </item>
  </channel>
</rss>

