<?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: Calculate Field using IF and FIND arcade statement in ArcGIS Online Questions</title>
    <link>https://community.esri.com/t5/arcgis-online-questions/calculate-field-using-if-and-find-arcade-statement/m-p/1543803#M61732</link>
    <description>&lt;P&gt;Thanks Ken and Cody that worked! ESRI Community is awesome!&lt;/P&gt;</description>
    <pubDate>Mon, 30 Sep 2024 14:54:09 GMT</pubDate>
    <dc:creator>JoshLay1</dc:creator>
    <dc:date>2024-09-30T14:54:09Z</dc:date>
    <item>
      <title>Calculate Field using IF and FIND arcade statement</title>
      <link>https://community.esri.com/t5/arcgis-online-questions/calculate-field-using-if-and-find-arcade-statement/m-p/1543782#M61727</link>
      <description>&lt;P&gt;I have two fields both are text and I am using the field calculator to calculate the empty field.&amp;nbsp; The populated field is name "groupNames" which contains values such as below.&amp;nbsp; The second field "agency" has no values and is where the calculated values are going.&amp;nbsp; I am trying to use arcade to find any values in the "GroupNames" field that contain the agency acronym such as "DDOT", then calculate the empty field with "DDOT" otherwise populate with "Undefined". I have been using the Arcade statements below but cannot get them to work.&amp;nbsp; Anyone have suggestions?&amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;IIF(Find('DDOT', $feature.groupNames)== 0, "DDOT", "Undefined")‍‍&lt;BR /&gt;IIF(Find('DPW', $feature.groupNames)== 0, "DPW", "Undefined")‍‍&lt;BR /&gt;IIF(Find('CFSA', $feature.groupNames)== 0, "CFSA", "Undefined")‍‍&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="JoshLay1_0-1727704272793.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/116139i8FCCC53E628C8894/image-size/medium?v=v2&amp;amp;px=400" role="button" title="JoshLay1_0-1727704272793.png" alt="JoshLay1_0-1727704272793.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;Josh&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 30 Sep 2024 14:02:30 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-online-questions/calculate-field-using-if-and-find-arcade-statement/m-p/1543782#M61727</guid>
      <dc:creator>JoshLay1</dc:creator>
      <dc:date>2024-09-30T14:02:30Z</dc:date>
    </item>
    <item>
      <title>Re: Calculate Field using IF and FIND arcade statement</title>
      <link>https://community.esri.com/t5/arcgis-online-questions/calculate-field-using-if-and-find-arcade-statement/m-p/1543786#M61728</link>
      <description>&lt;P&gt;Hey &lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/534294"&gt;@JoshLay1&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Looks like you almost have it, -1 is the way to find if a result is not present, you may need to use a negation, try this out:&lt;/P&gt;&lt;LI-CODE lang="c"&gt;IIf(Find('DDOT', $feature.groupNames) != -1, "DDOT", "Undefined")

IIf(Find('DPW', $feature.groupNames) != -1, "DPW", "Undefined")

IIf(Find('CFSA', $feature.groupNames) != -1, "CFSA", "Undefined")&lt;/LI-CODE&gt;&lt;P&gt;&lt;A href="https://developers.arcgis.com/arcade/function-reference/text_functions/#find" target="_blank"&gt;https://developers.arcgis.com/arcade/function-reference/text_functions/#find&lt;/A&gt;&lt;/P&gt;&lt;P&gt;Cody&lt;/P&gt;</description>
      <pubDate>Mon, 30 Sep 2024 14:01:11 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-online-questions/calculate-field-using-if-and-find-arcade-statement/m-p/1543786#M61728</guid>
      <dc:creator>CodyPatterson</dc:creator>
      <dc:date>2024-09-30T14:01:11Z</dc:date>
    </item>
    <item>
      <title>Re: Calculate Field using IF and FIND arcade statement</title>
      <link>https://community.esri.com/t5/arcgis-online-questions/calculate-field-using-if-and-find-arcade-statement/m-p/1543791#M61729</link>
      <description>&lt;P&gt;Thanks for the quick reply Cody.&lt;/P&gt;&lt;P&gt;I tried using your expression from line 1 as a test and received the error message below.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="JoshLay1_0-1727706004429.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/116140i4C845495A75F5535/image-size/medium?v=v2&amp;amp;px=400" role="button" title="JoshLay1_0-1727706004429.png" alt="JoshLay1_0-1727706004429.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 30 Sep 2024 14:20:38 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-online-questions/calculate-field-using-if-and-find-arcade-statement/m-p/1543791#M61729</guid>
      <dc:creator>JoshLay1</dc:creator>
      <dc:date>2024-09-30T14:20:38Z</dc:date>
    </item>
    <item>
      <title>Re: Calculate Field using IF and FIND arcade statement</title>
      <link>https://community.esri.com/t5/arcgis-online-questions/calculate-field-using-if-and-find-arcade-statement/m-p/1543796#M61730</link>
      <description>&lt;P&gt;If your goal is to get the agency name for each feature rather than finding the ones that are "DDOT", then you should use this.&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;When(Find('DDOT', $feature.groupNames) != -1, 'DDOT',
     Find('DPW', $feature.groupNames) != -1, 'DPW',
     Find("CFSA", $feature.groupNames) != -1, 'CFSA',
     // add all the other agency names you're looking for
     'undefined')&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 30 Sep 2024 14:31:52 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-online-questions/calculate-field-using-if-and-find-arcade-statement/m-p/1543796#M61730</guid>
      <dc:creator>KenBuja</dc:creator>
      <dc:date>2024-09-30T14:31:52Z</dc:date>
    </item>
    <item>
      <title>Re: Calculate Field using IF and FIND arcade statement</title>
      <link>https://community.esri.com/t5/arcgis-online-questions/calculate-field-using-if-and-find-arcade-statement/m-p/1543803#M61732</link>
      <description>&lt;P&gt;Thanks Ken and Cody that worked! ESRI Community is awesome!&lt;/P&gt;</description>
      <pubDate>Mon, 30 Sep 2024 14:54:09 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-online-questions/calculate-field-using-if-and-find-arcade-statement/m-p/1543803#M61732</guid>
      <dc:creator>JoshLay1</dc:creator>
      <dc:date>2024-09-30T14:54:09Z</dc:date>
    </item>
    <item>
      <title>Re: Calculate Field using IF and FIND arcade statement</title>
      <link>https://community.esri.com/t5/arcgis-online-questions/calculate-field-using-if-and-find-arcade-statement/m-p/1543804#M61733</link>
      <description>&lt;P&gt;If you have a long list of agencies to check, this might be a better way. You can modify the array of agencies easier than making a long When function&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;var agencies = ["DDOT", "PEMA", "CFSA"];
var output = "undefined";
for (var j in agencies) {
  if (Find(agencies[j], $feature.groupNames) != -1) output = agencies[j];
}
return output&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 30 Sep 2024 14:54:13 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-online-questions/calculate-field-using-if-and-find-arcade-statement/m-p/1543804#M61733</guid>
      <dc:creator>KenBuja</dc:creator>
      <dc:date>2024-09-30T14:54:13Z</dc:date>
    </item>
  </channel>
</rss>

