<?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: Constrain integer field to be not empty in ArcGIS Survey123 Questions</title>
    <link>https://community.esri.com/t5/arcgis-survey123-questions/constrain-integer-field-to-be-not-empty/m-p/836018#M19638</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Tom,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In Survey123 terms, a required field is a field that must not be blank - you should make the field required.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Another approach would be to wrap the the question in coalesce(${q}, 0) to provide a default value when blank.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 28 Jul 2020 21:34:06 GMT</pubDate>
    <dc:creator>JamesTedrick</dc:creator>
    <dc:date>2020-07-28T21:34:06Z</dc:date>
    <item>
      <title>Constrain integer field to be not empty</title>
      <link>https://community.esri.com/t5/arcgis-survey123-questions/constrain-integer-field-to-be-not-empty/m-p/836015#M19635</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I have an integer field called num1. Has a default of zero.&amp;nbsp; But you can erase that zero and leave the field blank.&amp;nbsp; This blank field is not considered an integer (kills calculations for instance).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I want to put a constraint on it so you don't leave it empty (i.e. no number, no text).&amp;nbsp; I can't seem to do it.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have tried testing to see what this "empty" integer field is interpreted as, and I can tell you this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;${num1}=''&amp;nbsp; &amp;nbsp;is FALSE&lt;BR /&gt;${num1}=NaN&amp;nbsp; is FALSE&lt;BR /&gt;number(${num1})&amp;nbsp; is&amp;nbsp;BLANK&lt;BR /&gt;string-length(${num1})&amp;nbsp; is 0&lt;BR /&gt;string-length(number(${num1})) is 0&lt;BR /&gt;string-length(string(${num1})) is 0&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;here is the survey with the num1 field empty:&lt;/P&gt;&lt;P&gt;&lt;IMG __jive_id="501544" alt="empty" class="jive-emoji image-1 jive-image" height="451" src="https://community.esri.com/legacyfs/online/501544_survey12.jpg" width="381" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;and here with the num1 field with a valid number:&lt;BR /&gt;&lt;IMG __jive_id="501572" alt="survey" class="jive-emoji image-2 jive-image" height="438" src="https://community.esri.com/legacyfs/online/501572_survey11.jpg" width="418" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I tried using any of these in a constraint (e.g. string-length(.)&amp;gt;0 ) but that is ignored, or not seen as an issue as it happily lets me submit with this blank integer field.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG __jive_id="501574" alt="s" class="image-3 jive-emoji jive-image" height="251" src="https://community.esri.com/legacyfs/online/501574_survey13.jpg" width="218" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Is there a way to constrain it?&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have worked around it by using a calculation in another field, but was hoping I would not need to do this.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;survey123 xlsx attached.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Tom S.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;P.S.&amp;nbsp; ${num1}=null is FALSE, ${num1}=undefined is FALSE as well.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 28 Jul 2020 19:09:47 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-survey123-questions/constrain-integer-field-to-be-not-empty/m-p/836015#M19635</guid>
      <dc:creator>TomSchwartzman</dc:creator>
      <dc:date>2020-07-28T19:09:47Z</dc:date>
    </item>
    <item>
      <title>Re: Constrain integer field to be not empty</title>
      <link>https://community.esri.com/t5/arcgis-survey123-questions/constrain-integer-field-to-be-not-empty/m-p/836016#M19636</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Does required work?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I had an issue for a bit that you had to use string-length != or = 0.&amp;nbsp; &amp;gt;0 never worked - not sure why but could be that it is considered text.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope that helps.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 28 Jul 2020 20:31:16 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-survey123-questions/constrain-integer-field-to-be-not-empty/m-p/836016#M19636</guid>
      <dc:creator>DougBrowning</dc:creator>
      <dc:date>2020-07-28T20:31:16Z</dc:date>
    </item>
    <item>
      <title>Re: Constrain integer field to be not empty</title>
      <link>https://community.esri.com/t5/arcgis-survey123-questions/constrain-integer-field-to-be-not-empty/m-p/836017#M19637</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks Doug for the reply.&amp;nbsp; Yes, required will do it, but I don't want to make it required if I don't have to. Maybe there is no difference between required and constraint of a number/digit, have to ponder that.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;My workaround was to make that field a null field and add another field that was calc'ed via an if statement, which honors the string-length query (if(string-length(${num1})=0,0,${num1})&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Tom&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 28 Jul 2020 20:39:00 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-survey123-questions/constrain-integer-field-to-be-not-empty/m-p/836017#M19637</guid>
      <dc:creator>TomSchwartzman</dc:creator>
      <dc:date>2020-07-28T20:39:00Z</dc:date>
    </item>
    <item>
      <title>Re: Constrain integer field to be not empty</title>
      <link>https://community.esri.com/t5/arcgis-survey123-questions/constrain-integer-field-to-be-not-empty/m-p/836018#M19638</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Tom,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In Survey123 terms, a required field is a field that must not be blank - you should make the field required.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Another approach would be to wrap the the question in coalesce(${q}, 0) to provide a default value when blank.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 28 Jul 2020 21:34:06 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-survey123-questions/constrain-integer-field-to-be-not-empty/m-p/836018#M19638</guid>
      <dc:creator>JamesTedrick</dc:creator>
      <dc:date>2020-07-28T21:34:06Z</dc:date>
    </item>
    <item>
      <title>Re: Constrain integer field to be not empty</title>
      <link>https://community.esri.com/t5/arcgis-survey123-questions/constrain-integer-field-to-be-not-empty/m-p/1104079#M37771</link>
      <description>&lt;P&gt;Hello, I know this thread is older but I stumbled on it when I was troubleshooting something in a survey and wanted to post a link to some useful esri documentation on &lt;A href="https://doc.arcgis.com/en/survey123/desktop/create-surveys/xlsformformulas.htm#ESRI_SECTION1_2954BF95CF674951AE9691A656CF157C" target="_blank" rel="noopener"&gt;empty values.&lt;/A&gt;&lt;/P&gt;&lt;P&gt;Particularly relevant to this particular post:&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;&lt;P&gt;Empty values for integer and decimal questions are represented as NaN (not a number). This is a special value that represents the absence of a valid value.&lt;/P&gt;&lt;/LI&gt;&lt;LI&gt;The NaN value compared to any other value is only true in a calculation of an is not equal value comparison. All other expressions result in false.&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;Hope this maybe helps someone!&lt;/P&gt;</description>
      <pubDate>Fri, 01 Oct 2021 19:44:14 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-survey123-questions/constrain-integer-field-to-be-not-empty/m-p/1104079#M37771</guid>
      <dc:creator>Katie_Clark</dc:creator>
      <dc:date>2021-10-01T19:44:14Z</dc:date>
    </item>
  </channel>
</rss>

