<?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 Arcade: How do I find the first empty field? in ArcGIS Online Questions</title>
    <link>https://community.esri.com/t5/arcgis-online-questions/arcade-how-do-i-find-the-first-empty-field/m-p/1178199#M46218</link>
    <description>&lt;P&gt;How do I get the&amp;nbsp;variable loopResults to find the first empty field and return it back to the stages variable for id:0, labeled Engineering? When I load the script, loopResults always returns project_designed if it's not empty&lt;/P&gt;&lt;LI-CODE lang="c"&gt;var Project_Design = Date($datapoint["Project_Designed"])
var PA_Sent = Date($datapoint["PA_Sent"])
var PA_Recvd = Date($datapoint["PA_Recvd"])

var loopResults = When(!IsEmpty(Project_Design), Project_Design,
					   !IsEmpty(PA_Sent), PA_Sent,
					   !IsEmpty(PA_Recvd), PA_Recvd,'')

var stages = [
    {
        id: 0,
        label: "Engineering",
        completionDate: loopResults,
        threshold: 60
    },
	{
        id: 1,
        label: "CSR",
        completionDate: $datapoint["App_to_Processing"],
        threshold: 60
    },{
        id: 2,
        label: "Operations",
        completionDate: $datapoint["To_Operations"],
        threshold: 5*60
    },{
        id: 3,
        label: "Construction",
        completionDate: $datapoint["To_Construction"],
        threshold: 22*60
    },{
        id: 4,
        label: "Done",
        completionDate: $datapoint["PA_Recvd"],
        threshold: null
    }
];&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Sun, 29 May 2022 13:15:21 GMT</pubDate>
    <dc:creator>neomapper</dc:creator>
    <dc:date>2022-05-29T13:15:21Z</dc:date>
    <item>
      <title>Arcade: How do I find the first empty field?</title>
      <link>https://community.esri.com/t5/arcgis-online-questions/arcade-how-do-i-find-the-first-empty-field/m-p/1178199#M46218</link>
      <description>&lt;P&gt;How do I get the&amp;nbsp;variable loopResults to find the first empty field and return it back to the stages variable for id:0, labeled Engineering? When I load the script, loopResults always returns project_designed if it's not empty&lt;/P&gt;&lt;LI-CODE lang="c"&gt;var Project_Design = Date($datapoint["Project_Designed"])
var PA_Sent = Date($datapoint["PA_Sent"])
var PA_Recvd = Date($datapoint["PA_Recvd"])

var loopResults = When(!IsEmpty(Project_Design), Project_Design,
					   !IsEmpty(PA_Sent), PA_Sent,
					   !IsEmpty(PA_Recvd), PA_Recvd,'')

var stages = [
    {
        id: 0,
        label: "Engineering",
        completionDate: loopResults,
        threshold: 60
    },
	{
        id: 1,
        label: "CSR",
        completionDate: $datapoint["App_to_Processing"],
        threshold: 60
    },{
        id: 2,
        label: "Operations",
        completionDate: $datapoint["To_Operations"],
        threshold: 5*60
    },{
        id: 3,
        label: "Construction",
        completionDate: $datapoint["To_Construction"],
        threshold: 22*60
    },{
        id: 4,
        label: "Done",
        completionDate: $datapoint["PA_Recvd"],
        threshold: null
    }
];&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 29 May 2022 13:15:21 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-online-questions/arcade-how-do-i-find-the-first-empty-field/m-p/1178199#M46218</guid>
      <dc:creator>neomapper</dc:creator>
      <dc:date>2022-05-29T13:15:21Z</dc:date>
    </item>
    <item>
      <title>Re: Arcade: How do I find the first empty field?</title>
      <link>https://community.esri.com/t5/arcgis-online-questions/arcade-how-do-i-find-the-first-empty-field/m-p/1178257#M46221</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;P&gt;&lt;SPAN&gt;How do I get the&amp;nbsp;variable loopResults to find the first empty field&lt;/SPAN&gt;&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;&lt;SPAN&gt;You're currently looking for &lt;STRONG&gt;!IsEmpty()&lt;/STRONG&gt;, so it returns the value of the first non-empty field. Remove the bangs:&lt;/SPAN&gt;&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;var loopResults = When(IsEmpty(Project_Design), Project_Design,
                       IsEmpty(PA_Sent), PA_Sent,
                       IsEmpty(PA_Recvd), PA_Recvd,
                       '')&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 30 May 2022 06:56:55 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-online-questions/arcade-how-do-i-find-the-first-empty-field/m-p/1178257#M46221</guid>
      <dc:creator>JohannesLindner</dc:creator>
      <dc:date>2022-05-30T06:56:55Z</dc:date>
    </item>
  </channel>
</rss>

