<?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 Validate a repeat to not have duplicates options selected in ArcGIS Survey123 Questions</title>
    <link>https://community.esri.com/t5/arcgis-survey123-questions/validate-a-repeat-to-not-have-duplicates-options/m-p/822456#M16136</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I need to validate a repeat to not have duplicates options selected.&amp;nbsp;&lt;/P&gt;&lt;P&gt;I think the workaround for this is to use a calculate using join('',${selectOnevariable}) and then another calculate to check if string have duplicates, I think using a regex could be done. The thing is that I'm not able to find a good expression to validate this. Obviously you can have consecutive duplicates (ej. 001 001) or non consecutives (ej 001 002 001)&lt;/P&gt;&lt;P&gt;Any ideas?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Daniel R.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 21 Jan 2019 21:07:45 GMT</pubDate>
    <dc:creator>DanielRivero</dc:creator>
    <dc:date>2019-01-21T21:07:45Z</dc:date>
    <item>
      <title>Validate a repeat to not have duplicates options selected</title>
      <link>https://community.esri.com/t5/arcgis-survey123-questions/validate-a-repeat-to-not-have-duplicates-options/m-p/822456#M16136</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I need to validate a repeat to not have duplicates options selected.&amp;nbsp;&lt;/P&gt;&lt;P&gt;I think the workaround for this is to use a calculate using join('',${selectOnevariable}) and then another calculate to check if string have duplicates, I think using a regex could be done. The thing is that I'm not able to find a good expression to validate this. Obviously you can have consecutive duplicates (ej. 001 001) or non consecutives (ej 001 002 001)&lt;/P&gt;&lt;P&gt;Any ideas?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Daniel R.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 21 Jan 2019 21:07:45 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-survey123-questions/validate-a-repeat-to-not-have-duplicates-options/m-p/822456#M16136</guid>
      <dc:creator>DanielRivero</dc:creator>
      <dc:date>2019-01-21T21:07:45Z</dc:date>
    </item>
    <item>
      <title>Re: Validate a repeat to not have duplicates options selected</title>
      <link>https://community.esri.com/t5/arcgis-survey123-questions/validate-a-repeat-to-not-have-duplicates-options/m-p/822457#M16137</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P style="background-color: #ffffff; border: 0px;"&gt;I was able to apply a constrain to the select-on field using a constrain with the following steps:&lt;/P&gt;&lt;P style="background-color: #ffffff; border: 0px;"&gt;1.- Calculate a join of the field: ej join('',${fieldselectone})&lt;/P&gt;&lt;P style="background-color: #ffffff; border: 0px;"&gt;2.- Calculate&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;STRONG style="border: 0px; font-weight: bold;"&gt;isrepeated&lt;/STRONG&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;field inside the repeat using a regular expression:&amp;nbsp;regex(join('',${&lt;SPAN style="border: 0px; font-weight: inherit;"&gt;fieldselectone&lt;/SPAN&gt;}),concat('^[0-9]*(',${&lt;SPAN style="border: 0px; font-weight: inherit;"&gt;fieldselectone&lt;/SPAN&gt;},')[0-9]*(',${&lt;SPAN style="border: 0px; font-weight: inherit;"&gt;fieldselectone&lt;/SPAN&gt;},')[0-9]*$'))&lt;/P&gt;&lt;P style="background-color: #ffffff; border: 0px;"&gt;Just note I'm using numbers [0-9] as the character set because on my case the&amp;nbsp;&lt;SPAN style="border: 0px; font-weight: inherit;"&gt;${fieldselectone} is a numeric code list, you could replace this wit [A-Z] or [A-Z0-9] for alpha&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="background-color: #ffffff; border: 0px;"&gt;&lt;SPAN style="border: 0px; font-weight: inherit;"&gt;3.- Apply the isRepeated field as constrain on the&amp;nbsp;${fieldselectone}. Ej&amp;nbsp;not(boolean-from-string(${isRepeated}))&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="background-color: #ffffff; border: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P style="background-color: #ffffff; border: 0px;"&gt;&lt;SPAN style="border: 0px; font-weight: inherit;"&gt;I hope it works for you.&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="background-color: #ffffff; border: 0px;"&gt;&lt;SPAN style="border: 0px; font-weight: inherit;"&gt;Regards,&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="background-color: #ffffff; border: 0px;"&gt;&lt;SPAN style="border: 0px; font-weight: inherit;"&gt;Daniel R.&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 23 Jan 2019 21:50:57 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-survey123-questions/validate-a-repeat-to-not-have-duplicates-options/m-p/822457#M16137</guid>
      <dc:creator>DanielRivero</dc:creator>
      <dc:date>2019-01-23T21:50:57Z</dc:date>
    </item>
  </channel>
</rss>

