<?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 FeatureSetByName Not Returning What I Expected in ArcGIS Online Questions</title>
    <link>https://community.esri.com/t5/arcgis-online-questions/arcade-featuresetbyname-not-returning-what-i/m-p/1244096#M49518</link>
    <description>&lt;P&gt;FeatureSerByName is grabbing a feature set, and you are testing values based on a feature.&amp;nbsp; So, need to grab the feature (or features) that you are interested in first.&lt;/P&gt;&lt;P&gt;The post here gives a good, simple example of how to intersect and grab the result: &lt;A href="https://community.esri.com/t5/arcgis-online-questions/arcade-intersect-returns-null-field-values/m-p/1174962" target="_self"&gt;FeatureSetBy......&lt;/A&gt;&lt;/P&gt;&lt;P&gt;Once you get it returning the result you are after ( [R], [D], [I], etc.), then you can build your "if" statements with a return for each comparisong.&lt;/P&gt;&lt;P&gt;R_&lt;/P&gt;&lt;P&gt;&lt;A href="https://community.esri.com/t5/python-blog/code-formatting-the-community-version/ba-p/1007633" target="_self"&gt;Also, link to entering code on forum for future reference.&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Wed, 28 Dec 2022 20:55:04 GMT</pubDate>
    <dc:creator>RhettZufelt</dc:creator>
    <dc:date>2022-12-28T20:55:04Z</dc:date>
    <item>
      <title>Arcade FeatureSetByName Not Returning What I Expected</title>
      <link>https://community.esri.com/t5/arcgis-online-questions/arcade-featuresetbyname-not-returning-what-i/m-p/1243674#M49502</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;I am struggling to return the attribute I want not because of Arcade but more from my logic in Arcade.&lt;/P&gt;&lt;P&gt;The pic below shows the same statement and the "return&amp;nbsp; aa" which returns [R] and is correct but then the "return results" returns "000000" and I thought it would return FF0000 which is what I'd like. Any guidance would be huge.&lt;/P&gt;&lt;P&gt;Thank you so much.&lt;/P&gt;&lt;P&gt;GR&lt;/P&gt;</description>
      <pubDate>Sun, 25 Dec 2022 19:15:25 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-online-questions/arcade-featuresetbyname-not-returning-what-i/m-p/1243674#M49502</guid>
      <dc:creator>GregReinecke</dc:creator>
      <dc:date>2022-12-25T19:15:25Z</dc:date>
    </item>
    <item>
      <title>Re: Arcade FeatureSetByName Not Returning What I Expected</title>
      <link>https://community.esri.com/t5/arcgis-online-questions/arcade-featuresetbyname-not-returning-what-i/m-p/1244079#M49516</link>
      <description>&lt;P&gt;Without seeing at least some code, hard to guess what you are trying to achieve, but looks like a &lt;A href="https://developers.arcgis.com/arcade/function-reference/text_functions/#text" target="_self"&gt;Text() formatting useage&lt;/A&gt;.&lt;/P&gt;&lt;P&gt;Perhaps something like:&lt;/P&gt;&lt;LI-CODE lang="c"&gt;Text($feature.COLUMNAME, 'FF0000')&lt;/LI-CODE&gt;&lt;P&gt;R_&lt;/P&gt;</description>
      <pubDate>Wed, 28 Dec 2022 19:32:12 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-online-questions/arcade-featuresetbyname-not-returning-what-i/m-p/1244079#M49516</guid>
      <dc:creator>RhettZufelt</dc:creator>
      <dc:date>2022-12-28T19:32:12Z</dc:date>
    </item>
    <item>
      <title>Re: Arcade FeatureSetByName Not Returning What I Expected</title>
      <link>https://community.esri.com/t5/arcgis-online-questions/arcade-featuresetbyname-not-returning-what-i/m-p/1244087#M49517</link>
      <description>&lt;P&gt;Thank you Rhett. The expression below (which 've tried many ways now) ignores the evaluation and just returns ["000000"] .&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;IF&lt;/SPAN&gt;&lt;SPAN&gt; (&lt;/SPAN&gt;&lt;SPAN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] or [I] from the FeatureSetByName layer but no matter what I have done, it doesn't assign the corresponding color hex code which I would than use when I put the expression in some html. I appreciate your help.&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;Thanks,&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;GR&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Wed, 28 Dec 2022 20:03:27 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-online-questions/arcade-featuresetbyname-not-returning-what-i/m-p/1244087#M49517</guid>
      <dc:creator>GregReinecke</dc:creator>
      <dc:date>2022-12-28T20:03:27Z</dc:date>
    </item>
    <item>
      <title>Re: Arcade FeatureSetByName Not Returning What I Expected</title>
      <link>https://community.esri.com/t5/arcgis-online-questions/arcade-featuresetbyname-not-returning-what-i/m-p/1244096#M49518</link>
      <description>&lt;P&gt;FeatureSerByName is grabbing a feature set, and you are testing values based on a feature.&amp;nbsp; So, need to grab the feature (or features) that you are interested in first.&lt;/P&gt;&lt;P&gt;The post here gives a good, simple example of how to intersect and grab the result: &lt;A href="https://community.esri.com/t5/arcgis-online-questions/arcade-intersect-returns-null-field-values/m-p/1174962" target="_self"&gt;FeatureSetBy......&lt;/A&gt;&lt;/P&gt;&lt;P&gt;Once you get it returning the result you are after ( [R], [D], [I], etc.), then you can build your "if" statements with a return for each comparisong.&lt;/P&gt;&lt;P&gt;R_&lt;/P&gt;&lt;P&gt;&lt;A href="https://community.esri.com/t5/python-blog/code-formatting-the-community-version/ba-p/1007633" target="_self"&gt;Also, link to entering code on forum for future reference.&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 28 Dec 2022 20:55:04 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-online-questions/arcade-featuresetbyname-not-returning-what-i/m-p/1244096#M49518</guid>
      <dc:creator>RhettZufelt</dc:creator>
      <dc:date>2022-12-28T20:55:04Z</dc:date>
    </item>
    <item>
      <title>Re: Arcade FeatureSetByName Not Returning What I Expected</title>
      <link>https://community.esri.com/t5/arcgis-online-questions/arcade-featuresetbyname-not-returning-what-i/m-p/1244158#M49525</link>
      <description>&lt;P&gt;Rhett,&lt;/P&gt;&lt;P&gt;You got me thinking logically. I created the expression&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="c"&gt;var aa = Intersects(FeatureSetByName($map, "StatesWithSenators",['Fname1','LName1', 'Balloted1']),Centroid($feature))
for (var f in aa)

if(text(f.Balloted1) == "[R]") {
  return "FF0000"
}
if(text(f.Balloted1) == "[D]") {
  return "0000FF"
}
if(text(f.Balloted1) == "[I]") {
  return "BEBEBE"
}&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;and then added to the text source for my pop up&lt;/P&gt;&lt;LI-CODE lang="c"&gt;&amp;lt;span style="font-size:large;"&amp;gt;Senator(s): &amp;lt;font color="{expression/expr8}"&amp;gt;{expression/expr10}&amp;lt;/font&amp;gt;&lt;/LI-CODE&gt;&lt;P&gt;and it worked out perfectly. Thank you so much.&lt;/P&gt;&lt;P&gt;GR&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 29 Dec 2022 02:16:10 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-online-questions/arcade-featuresetbyname-not-returning-what-i/m-p/1244158#M49525</guid>
      <dc:creator>GregReinecke</dc:creator>
      <dc:date>2022-12-29T02:16:10Z</dc:date>
    </item>
  </channel>
</rss>

