<?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: Constraint on an integer field works when using a web browser but not when using the Survey123 mobile app in ArcGIS Survey123 Questions</title>
    <link>https://community.esri.com/t5/arcgis-survey123-questions/constraint-on-an-integer-field-works-when-using-a/m-p/1353554#M53056</link>
    <description>&lt;P&gt;*UPDATE* I added some additional constraints to be a value between 0 and 24 and added the 15 minute interval as a modulo operation and the constraint seems to be working now in browsers and mobile apps.&lt;/P&gt;&lt;TABLE width="293"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD width="293"&gt;&lt;P&gt;. and ${TimeField} &amp;lt;=24 and ${TimeField} &amp;gt;= 0 and (${TimeField} *100) mod 25 = 0&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;</description>
    <pubDate>Mon, 27 Nov 2023 16:13:57 GMT</pubDate>
    <dc:creator>OregonStateMarineBoard</dc:creator>
    <dc:date>2023-11-27T16:13:57Z</dc:date>
    <item>
      <title>Constraint on an integer field works when using a web browser but not when using the Survey123 mobile app</title>
      <link>https://community.esri.com/t5/arcgis-survey123-questions/constraint-on-an-integer-field-works-when-using-a/m-p/1352696#M53020</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;I'm trying to establish a constraint in Survey123 to restrict the allowable values in an integer field to only allow multiples of 0.25. The purpose of the field is for users to enter how much time they spent on an activity and we want it to be in 15 minute increments. I was able to get some different expressions to work on a browser but none of them worked using the survey123 app. Using a constraint would prevent any and all values from being accepted in the mobile app. Any value entered would result in a constraint violation in the survey123 mobile app.&lt;/P&gt;&lt;P&gt;&lt;U&gt;&lt;STRONG&gt;Here are some of the different options I tried:&lt;/STRONG&gt;&lt;/U&gt;&lt;/P&gt;&lt;P&gt;1) .25 * round(${mpHOURS} * 4) = ${mpHOURS}&lt;/P&gt;&lt;P&gt;2)&amp;nbsp;(${mpHOURS}*4 - floor(${mpHOURS}*4)) = 0&lt;/P&gt;&lt;P&gt;3)&amp;nbsp;regex(string(${mpHOURS}), '^\d+ (\.00|\.25|\.50|\.75)?$')&lt;/P&gt;&lt;P&gt;4) Javascript function&lt;/P&gt;&lt;P&gt;function isMultipleOfQuarter(value) {&lt;/P&gt;&lt;P&gt;var multiplied = value * 4;&lt;/P&gt;&lt;P&gt;return multiplied ===&lt;/P&gt;&lt;P&gt;Math.floor(multiplied);}&lt;/P&gt;&lt;P&gt;&lt;U&gt;&lt;STRONG&gt;Additional Information:&lt;/STRONG&gt;&lt;/U&gt;&lt;/P&gt;&lt;P&gt;Field type is decimal&lt;/P&gt;&lt;P&gt;published in Survey123 Connect version 3.18.123&lt;/P&gt;&lt;P&gt;Thank you!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 22 Nov 2023 17:56:09 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-survey123-questions/constraint-on-an-integer-field-works-when-using-a/m-p/1352696#M53020</guid>
      <dc:creator>OregonStateMarineBoard</dc:creator>
      <dc:date>2023-11-22T17:56:09Z</dc:date>
    </item>
    <item>
      <title>Re: Constraint on an integer field works when using a web browser but not when using the Survey123 mobile app</title>
      <link>https://community.esri.com/t5/arcgis-survey123-questions/constraint-on-an-integer-field-works-when-using-a/m-p/1352733#M53023</link>
      <description>&lt;P&gt;Not the best at JS, but this should work:&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;function isMultipleOfQuarter(var1) {
    var var1 = var1/0.25;

    var1 = var1 - Math.floor(var1)

    return var1;
}&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Not a multiple of 0.25:&lt;BR /&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="abureaux_0-1700679017086.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/86916iE1815A69679E6465/image-size/medium?v=v2&amp;amp;px=400" role="button" title="abureaux_0-1700679017086.png" alt="abureaux_0-1700679017086.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Multiple of 0.25:&lt;BR /&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="abureaux_1-1700679038799.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/86917i0908956C003E3A31/image-size/medium?v=v2&amp;amp;px=400" role="button" title="abureaux_1-1700679038799.png" alt="abureaux_1-1700679038799.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 22 Nov 2023 18:51:01 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-survey123-questions/constraint-on-an-integer-field-works-when-using-a/m-p/1352733#M53023</guid>
      <dc:creator>abureaux</dc:creator>
      <dc:date>2023-11-22T18:51:01Z</dc:date>
    </item>
    <item>
      <title>Re: Constraint on an integer field works when using a web browser but not when using the Survey123 mobile app</title>
      <link>https://community.esri.com/t5/arcgis-survey123-questions/constraint-on-an-integer-field-works-when-using-a/m-p/1352738#M53024</link>
      <description>&lt;P&gt;First thing I always check on these is the bind::type column.&amp;nbsp; Make sure to set that or it can be treated as string.&lt;/P&gt;</description>
      <pubDate>Wed, 22 Nov 2023 18:59:15 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-survey123-questions/constraint-on-an-integer-field-works-when-using-a/m-p/1352738#M53024</guid>
      <dc:creator>DougBrowning</dc:creator>
      <dc:date>2023-11-22T18:59:15Z</dc:date>
    </item>
    <item>
      <title>Re: Constraint on an integer field works when using a web browser but not when using the Survey123 mobile app</title>
      <link>https://community.esri.com/t5/arcgis-survey123-questions/constraint-on-an-integer-field-works-when-using-a/m-p/1353554#M53056</link>
      <description>&lt;P&gt;*UPDATE* I added some additional constraints to be a value between 0 and 24 and added the 15 minute interval as a modulo operation and the constraint seems to be working now in browsers and mobile apps.&lt;/P&gt;&lt;TABLE width="293"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD width="293"&gt;&lt;P&gt;. and ${TimeField} &amp;lt;=24 and ${TimeField} &amp;gt;= 0 and (${TimeField} *100) mod 25 = 0&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;</description>
      <pubDate>Mon, 27 Nov 2023 16:13:57 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-survey123-questions/constraint-on-an-integer-field-works-when-using-a/m-p/1353554#M53056</guid>
      <dc:creator>OregonStateMarineBoard</dc:creator>
      <dc:date>2023-11-27T16:13:57Z</dc:date>
    </item>
  </channel>
</rss>

