<?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: Workaround: evaluate regex constraint before submission of form in ArcGIS Survey123 Questions</title>
    <link>https://community.esri.com/t5/arcgis-survey123-questions/workaround-evaluate-regex-constraint-before/m-p/1514399#M58296</link>
    <description>&lt;P&gt;I'd make ${namecheck} a calculate. That way you can drop the "label" and "appearance". Less work is always a good thing.&lt;/P&gt;&lt;P&gt;Also, notes don't need "names", so you can delete "nameerrornote" from the name column entirely.&lt;/P&gt;&lt;P&gt;Otherwise ya, doing it line by line is the only way.&lt;/P&gt;&lt;P&gt;As &lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/16421"&gt;@DougBrowning&lt;/a&gt; mentioned, emojis work well for visual feedback (would be amazing if that was a built-in behaviour). But in the end, do whatever works well for you.&lt;/P&gt;</description>
    <pubDate>Fri, 02 Aug 2024 20:24:58 GMT</pubDate>
    <dc:creator>abureaux</dc:creator>
    <dc:date>2024-08-02T20:24:58Z</dc:date>
    <item>
      <title>Workaround: evaluate regex constraint before submission of form</title>
      <link>https://community.esri.com/t5/arcgis-survey123-questions/workaround-evaluate-regex-constraint-before/m-p/1513670#M58265</link>
      <description>&lt;P data-unlink="true"&gt;A known deficiency with the current version of Survey123 Connect is that it does not evaluate constraints until form submission. Many users have the need or desire to have their surveys evaluate a regular expression constraint before proceeding to the next question or next page in their form (more on the problem &lt;A href="https://community.esri.com/t5/arcgis-survey123-questions/constraint-validation-occurs-only-when-the-survey/td-p/798610" target="_self"&gt;here&lt;/A&gt;).&lt;BR /&gt;&lt;BR /&gt;Below is a possible (although somewhat clunky) work-around. It uses 'note' type rows so that no new fields are required in the data schema.&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;OL&gt;&lt;LI&gt;Identify the data field row that you want to validate with regex and insert two new rows below it.&lt;/LI&gt;&lt;LI&gt;Set both new row types to '&lt;EM&gt;note&lt;/EM&gt;'.&lt;/LI&gt;&lt;LI&gt;For the first note, make its '&lt;EM&gt;appearance&lt;/EM&gt;' hidden and write an '&lt;EM&gt;if&lt;/EM&gt;' expression in the '&lt;EM&gt;calculation&lt;/EM&gt;' column that evaluates your regex expression, returning some simple Boolean-like values like &lt;EM&gt;OK/bad&lt;/EM&gt;, &lt;EM&gt;True/False&lt;/EM&gt;, &lt;EM&gt;Yes/No&lt;/EM&gt;, etc. Example:&amp;nbsp;&amp;nbsp;&lt;STRONG&gt;&lt;FONT face="courier new,courier"&gt;if(regex(${field2check}, '^[a-zA-Z]'), "OK", "bad")&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/LI&gt;&lt;LI&gt;For the second note row, leave its '&lt;EM&gt;appearance&lt;/EM&gt;' visible, but set its '&lt;EM&gt;relevant&lt;/EM&gt;' column to&amp;nbsp;&lt;STRONG&gt;&lt;FONT face="courier new,courier"&gt;${field2check}!="" and ${calc_row}!="OK" &lt;/FONT&gt;&lt;/STRONG&gt;(this means that this note will &lt;U&gt;not&lt;/U&gt; be visible unless the field that you're trying to validate is &lt;U&gt;not&lt;/U&gt; blank and it has been evaluated as &lt;U&gt;not&lt;/U&gt; "&lt;EM&gt;OK&lt;/EM&gt;" by the calculation done in the row above. Set the text ('label') for this row to whatever you want your error message to be.&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;Here is a simplified example:&lt;BR /&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="MattGoodman_0-1722525557075.png" style="width: 999px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/111358i5BA46E6772B8202C/image-size/large?v=v2&amp;amp;px=999" role="button" title="MattGoodman_0-1722525557075.png" alt="MattGoodman_0-1722525557075.png" /&gt;&lt;/span&gt;&lt;TABLE border="1" width="99.99999999999999%"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD width="4.160475482912332%"&gt;type&lt;/TD&gt;&lt;TD width="9.286775631500744%"&gt;name&lt;/TD&gt;&lt;TD width="7.057949479940564%"&gt;label&lt;/TD&gt;&lt;TD width="7.206537890044576%"&gt;appearance&lt;/TD&gt;&lt;TD width="5.49777117384844%"&gt;required&lt;/TD&gt;&lt;TD width="10.846953937592868%"&gt;required_message&lt;/TD&gt;&lt;TD width="10.029717682020802%"&gt;calculation&lt;/TD&gt;&lt;TD width="6.092124814264487%"&gt;constraint&lt;/TD&gt;&lt;TD width="15.973254086181276%"&gt;constraint_message::default&lt;/TD&gt;&lt;TD width="11.515601783060921%"&gt;constraint_message&lt;/TD&gt;&lt;TD width="12.332838038632987%"&gt;relevant&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="4.160475482912332%"&gt;begin group&lt;/TD&gt;&lt;TD width="9.286775631500744%"&gt;user_info&lt;/TD&gt;&lt;TD width="7.057949479940564%"&gt;User Info&lt;/TD&gt;&lt;TD width="7.206537890044576%"&gt;field-list&lt;/TD&gt;&lt;TD width="5.49777117384844%"&gt;&amp;nbsp;&lt;/TD&gt;&lt;TD width="10.846953937592868%"&gt;&amp;nbsp;&lt;/TD&gt;&lt;TD width="10.029717682020802%"&gt;&amp;nbsp;&lt;/TD&gt;&lt;TD width="6.092124814264487%"&gt;&amp;nbsp;&lt;/TD&gt;&lt;TD width="15.973254086181276%"&gt;&amp;nbsp;&lt;/TD&gt;&lt;TD width="11.515601783060921%"&gt;&amp;nbsp;&lt;/TD&gt;&lt;TD width="12.332838038632987%"&gt;&amp;nbsp;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="4.160475482912332%"&gt;text&lt;/TD&gt;&lt;TD width="9.286775631500744%"&gt;name&lt;/TD&gt;&lt;TD width="7.057949479940564%"&gt;Name&lt;/TD&gt;&lt;TD width="7.206537890044576%"&gt;&amp;nbsp;&lt;/TD&gt;&lt;TD width="5.49777117384844%"&gt;yes&lt;/TD&gt;&lt;TD width="10.846953937592868%"&gt;Enter a valid name to proceed&lt;/TD&gt;&lt;TD width="10.029717682020802%"&gt;&amp;nbsp;&lt;/TD&gt;&lt;TD width="6.092124814264487%"&gt;&amp;nbsp;&lt;/TD&gt;&lt;TD width="15.973254086181276%"&gt;&amp;nbsp;&lt;/TD&gt;&lt;TD width="11.515601783060921%"&gt;&amp;nbsp;&lt;/TD&gt;&lt;TD width="12.332838038632987%"&gt;&amp;nbsp;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="4.160475482912332%"&gt;note&lt;/TD&gt;&lt;TD width="9.286775631500744%"&gt;namecheck&lt;/TD&gt;&lt;TD width="7.057949479940564%"&gt;namecheck&lt;/TD&gt;&lt;TD width="7.206537890044576%"&gt;hidden&lt;/TD&gt;&lt;TD width="5.49777117384844%"&gt;&amp;nbsp;&lt;/TD&gt;&lt;TD width="10.846953937592868%"&gt;&amp;nbsp;&lt;/TD&gt;&lt;TD width="10.029717682020802%"&gt;if(regex(${name}, '^[a-zA-Z]'), "OK", "")&lt;/TD&gt;&lt;TD width="6.092124814264487%"&gt;&amp;nbsp;&lt;/TD&gt;&lt;TD width="15.973254086181276%"&gt;&amp;nbsp;&lt;/TD&gt;&lt;TD width="11.515601783060921%"&gt;&amp;nbsp;&lt;/TD&gt;&lt;TD width="12.332838038632987%"&gt;&amp;nbsp;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="4.160475482912332%"&gt;note&lt;/TD&gt;&lt;TD width="9.286775631500744%"&gt;nameerrornote&lt;/TD&gt;&lt;TD width="7.057949479940564%"&gt;Enter a valid name to proceed&lt;/TD&gt;&lt;TD width="7.206537890044576%"&gt;&amp;nbsp;&lt;/TD&gt;&lt;TD width="5.49777117384844%"&gt;&amp;nbsp;&lt;/TD&gt;&lt;TD width="10.846953937592868%"&gt;&amp;nbsp;&lt;/TD&gt;&lt;TD width="10.029717682020802%"&gt;&amp;nbsp;&lt;/TD&gt;&lt;TD width="6.092124814264487%"&gt;&amp;nbsp;&lt;/TD&gt;&lt;TD width="15.973254086181276%"&gt;&amp;nbsp;&lt;/TD&gt;&lt;TD width="11.515601783060921%"&gt;&amp;nbsp;&lt;/TD&gt;&lt;TD width="12.332838038632987%"&gt;${name}!="" and ${namecheck}!="OK"&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="4.160475482912332%"&gt;range&lt;/TD&gt;&lt;TD width="9.286775631500744%"&gt;age&lt;/TD&gt;&lt;TD width="7.057949479940564%"&gt;Age&lt;/TD&gt;&lt;TD width="7.206537890044576%"&gt;&amp;nbsp;&lt;/TD&gt;&lt;TD width="5.49777117384844%"&gt;yes&lt;/TD&gt;&lt;TD width="10.846953937592868%"&gt;&amp;nbsp;&lt;/TD&gt;&lt;TD width="10.029717682020802%"&gt;&amp;nbsp;&lt;/TD&gt;&lt;TD width="6.092124814264487%"&gt;&amp;nbsp;&lt;/TD&gt;&lt;TD width="15.973254086181276%"&gt;&amp;nbsp;&lt;/TD&gt;&lt;TD width="11.515601783060921%"&gt;&amp;nbsp;&lt;/TD&gt;&lt;TD width="12.332838038632987%"&gt;${namecheck}="OK"&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="4.160475482912332%"&gt;text&lt;/TD&gt;&lt;TD width="9.286775631500744%"&gt;additionalnotes&lt;/TD&gt;&lt;TD width="7.057949479940564%"&gt;Additional Notes&lt;/TD&gt;&lt;TD width="7.206537890044576%"&gt;&amp;nbsp;&lt;/TD&gt;&lt;TD width="5.49777117384844%"&gt;&amp;nbsp;&lt;/TD&gt;&lt;TD width="10.846953937592868%"&gt;&amp;nbsp;&lt;/TD&gt;&lt;TD width="10.029717682020802%"&gt;&amp;nbsp;&lt;/TD&gt;&lt;TD width="6.092124814264487%"&gt;&amp;nbsp;&lt;/TD&gt;&lt;TD width="15.973254086181276%"&gt;&amp;nbsp;&lt;/TD&gt;&lt;TD width="11.515601783060921%"&gt;&amp;nbsp;&lt;/TD&gt;&lt;TD width="12.332838038632987%"&gt;${age}!=""&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="4.160475482912332%"&gt;end group&lt;/TD&gt;&lt;TD width="9.286775631500744%"&gt;&amp;nbsp;&lt;/TD&gt;&lt;TD width="7.057949479940564%"&gt;&amp;nbsp;&lt;/TD&gt;&lt;TD width="7.206537890044576%"&gt;&amp;nbsp;&lt;/TD&gt;&lt;TD width="5.49777117384844%"&gt;&amp;nbsp;&lt;/TD&gt;&lt;TD width="10.846953937592868%"&gt;&amp;nbsp;&lt;/TD&gt;&lt;TD width="10.029717682020802%"&gt;&amp;nbsp;&lt;/TD&gt;&lt;TD width="6.092124814264487%"&gt;&amp;nbsp;&lt;/TD&gt;&lt;TD width="15.973254086181276%"&gt;&amp;nbsp;&lt;/TD&gt;&lt;TD width="11.515601783060921%"&gt;&amp;nbsp;&lt;/TD&gt;&lt;TD width="12.332838038632987%"&gt;&amp;nbsp;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;/LI&gt;&lt;/OL&gt;&lt;P&gt;There may be more elegant workarounds, so if you're aware of ways to make this more slick, please comment.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 01 Aug 2024 15:24:22 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-survey123-questions/workaround-evaluate-regex-constraint-before/m-p/1513670#M58265</guid>
      <dc:creator>Matt-Goodman</dc:creator>
      <dc:date>2024-08-01T15:24:22Z</dc:date>
    </item>
    <item>
      <title>Re: Workaround: evaluate regex constraint before submission of form</title>
      <link>https://community.esri.com/t5/arcgis-survey123-questions/workaround-evaluate-regex-constraint-before/m-p/1513674#M58267</link>
      <description>&lt;P&gt;I think it's a solid workaround, similar to what we do for immediate feedback on some of our forms.&lt;/P&gt;&lt;P&gt;Edit to add: if there's a better way to accomplish this, I'd love to know, too!&lt;/P&gt;</description>
      <pubDate>Thu, 01 Aug 2024 15:28:59 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-survey123-questions/workaround-evaluate-regex-constraint-before/m-p/1513674#M58267</guid>
      <dc:creator>jcarlson</dc:creator>
      <dc:date>2024-08-01T15:28:59Z</dc:date>
    </item>
    <item>
      <title>Re: Workaround: evaluate regex constraint before submission of form</title>
      <link>https://community.esri.com/t5/arcgis-survey123-questions/workaround-evaluate-regex-constraint-before/m-p/1513821#M58274</link>
      <description>&lt;P&gt;My method to use emoji's has been working out well.&amp;nbsp; It does not stop them though.&lt;/P&gt;&lt;P&gt;&lt;A href="https://community.esri.com/t5/arcgis-survey123-documents/how-to-simulate-instant-data-checking-using-emojis/ta-p/916725" target="_blank"&gt;https://community.esri.com/t5/arcgis-survey123-documents/how-to-simulate-instant-data-checking-using-emojis/ta-p/916725&lt;/A&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 01 Aug 2024 18:36:54 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-survey123-questions/workaround-evaluate-regex-constraint-before/m-p/1513821#M58274</guid>
      <dc:creator>DougBrowning</dc:creator>
      <dc:date>2024-08-01T18:36:54Z</dc:date>
    </item>
    <item>
      <title>Re: Workaround: evaluate regex constraint before submission of form</title>
      <link>https://community.esri.com/t5/arcgis-survey123-questions/workaround-evaluate-regex-constraint-before/m-p/1514399#M58296</link>
      <description>&lt;P&gt;I'd make ${namecheck} a calculate. That way you can drop the "label" and "appearance". Less work is always a good thing.&lt;/P&gt;&lt;P&gt;Also, notes don't need "names", so you can delete "nameerrornote" from the name column entirely.&lt;/P&gt;&lt;P&gt;Otherwise ya, doing it line by line is the only way.&lt;/P&gt;&lt;P&gt;As &lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/16421"&gt;@DougBrowning&lt;/a&gt; mentioned, emojis work well for visual feedback (would be amazing if that was a built-in behaviour). But in the end, do whatever works well for you.&lt;/P&gt;</description>
      <pubDate>Fri, 02 Aug 2024 20:24:58 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-survey123-questions/workaround-evaluate-regex-constraint-before/m-p/1514399#M58296</guid>
      <dc:creator>abureaux</dc:creator>
      <dc:date>2024-08-02T20:24:58Z</dc:date>
    </item>
  </channel>
</rss>

