<?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: Create a constraint based on values in another feature class field? in ArcGIS Survey123 Questions</title>
    <link>https://community.esri.com/t5/arcgis-survey123-questions/create-a-constraint-based-on-values-in-another/m-p/1647369#M64034</link>
    <description>&lt;P&gt;Glad it is working,&amp;nbsp; interesting that it didn't work previously, it appears to be the same as in your previous post.&amp;nbsp; Sometimes getting the syntax correct is the hardest part.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Neal_t_k_0-1756828099554.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/139753iE53EC83C9F5854C4/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Neal_t_k_0-1756828099554.png" alt="Neal_t_k_0-1756828099554.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Tue, 02 Sep 2025 15:49:52 GMT</pubDate>
    <dc:creator>Neal_t_k</dc:creator>
    <dc:date>2025-09-02T15:49:52Z</dc:date>
    <item>
      <title>Create a constraint based on values in another feature class field?</title>
      <link>https://community.esri.com/t5/arcgis-survey123-questions/create-a-constraint-based-on-values-in-another/m-p/1646923#M64008</link>
      <description>&lt;P&gt;I would like to set up a constraint for a field that validates whether the value entered exists in a specific field within a separate ArcGIS Online feature class.&lt;/P&gt;&lt;P&gt;I am using the latest Survey123 Connect in ArcGIS online. The end users will be using a web form to fill this out.&lt;/P&gt;&lt;P&gt;&lt;U&gt;Use case:&lt;/U&gt;&lt;BR /&gt;We require users to enter their license number as a mandatory field. We intentionally do not want to use a dropdown menu to avoid the risk of users selecting the wrong license or using someone else's license if they don’t have one.&lt;/P&gt;&lt;P&gt;Instead, once the user manually enters their license number, we want to validate that input against a field in a AGOL feature class to ensure it exists in the dataset.&lt;/P&gt;&lt;P&gt;This validation dataset is accessible to all users who will be filling out the survey.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;let me know if anyone has done something like this or if this is possible.&lt;/P&gt;&lt;P&gt;Thanks!&lt;/P&gt;</description>
      <pubDate>Fri, 29 Aug 2025 18:38:54 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-survey123-questions/create-a-constraint-based-on-values-in-another/m-p/1646923#M64008</guid>
      <dc:creator>mklatt_cityofventura_ca_gov</dc:creator>
      <dc:date>2025-08-29T18:38:54Z</dc:date>
    </item>
    <item>
      <title>Re: Create a constraint based on values in another feature class field?</title>
      <link>https://community.esri.com/t5/arcgis-survey123-questions/create-a-constraint-based-on-values-in-another/m-p/1646938#M64009</link>
      <description>&lt;H1&gt;&lt;FONT size="3"&gt;pulldata("@layer")&amp;nbsp; I think will get you what you are after.&lt;/FONT&gt;&lt;/H1&gt;&lt;P&gt;&lt;A href="https://community.esri.com/t5/arcgis-survey123-blog/survey123-tricks-of-the-trade-pulldata-quot-layer/ba-p/1224415" target="_blank" rel="noopener"&gt;https://community.esri.com/t5/arcgis-survey123-blog/survey123-tricks-of-the-trade-pulldata-quot-layer/ba-p/1224415&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="https://doc.arcgis.com/en/survey123/desktop/create-surveys/xlsformformulas.htm#ESRI_SECTION1_BB97985CAFB740EE8AEF99EFD6E238E3" target="_blank" rel="noopener"&gt;https://doc.arcgis.com/en/survey123/desktop/create-surveys/xlsformformulas.htm#ESRI_SECTION1_BB97985CAFB740EE8AEF99EFD6E238E3&lt;/A&gt;&lt;/P&gt;&lt;P&gt;setup a calculate field to pull their license number from the layer based on the license number in the hosted feature.&amp;nbsp; Then in your license number question in the constraints field build your constraint to make sure they match.&amp;nbsp; &amp;nbsp;I haven't tried pulling the same number I am matching however.&amp;nbsp; Are there any other fields you can match in the hosted layer (customer id) or something incase retrieving the license number based on match that licensing number doesn't work?&lt;/P&gt;&lt;P&gt;Edit: Just checked and pulling the license number should working on matching the license number in the same field.&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;here is some code to get you started:&lt;/P&gt;&lt;P&gt;Lic_Number_Question constraint: .=${Hidden_Calculate_question}&lt;/P&gt;&lt;P&gt;WhCl calculate: concat("Lic_Num = ",${Lic_Number_Question})&lt;/P&gt;&lt;P&gt;Hidden_Calculate_question: calculate: pulldata("@layer", "getValue", "attributes.Lic_Num", "&amp;lt;url&amp;gt;", ${WhCl})&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 29 Aug 2025 19:20:10 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-survey123-questions/create-a-constraint-based-on-values-in-another/m-p/1646938#M64009</guid>
      <dc:creator>Neal_t_k</dc:creator>
      <dc:date>2025-08-29T19:20:10Z</dc:date>
    </item>
    <item>
      <title>Re: Create a constraint based on values in another feature class field?</title>
      <link>https://community.esri.com/t5/arcgis-survey123-questions/create-a-constraint-based-on-values-in-another/m-p/1646962#M64011</link>
      <description>&lt;P&gt;Never done something exactly like this, but I reckon that if you have the validation dataset available as a feature service (don't know if this is the same as a feature class, I'm still kinda naive...) within your AGOL portal, what you are seeking to do is 100% possible.&lt;/P&gt;&lt;P&gt;I think you could do this with pulldata("@json") - there may be other ways as well but here's how I would do this:&lt;/P&gt;&lt;OL&gt;&lt;LI&gt;Get the user's license number as text/string input&lt;/LI&gt;&lt;LI&gt;You may have to pre-process the input to match your validation layer's values (e.g. strip out dashes/spaces, convert to uppercase, etc)&lt;/LI&gt;&lt;LI&gt;Use pulldata("@json") to query your validation layer with the user's license input&lt;BR /&gt;&lt;EM&gt;Something like pulldata("@json", "$", "&lt;A href="https://services" target="_blank"&gt;https://services&lt;/A&gt;&amp;lt;#&amp;gt;.arcgis.com/&amp;lt;YOUR ORG ID&amp;gt;/arcgis/rest/services/&amp;lt;YOUR VALIDATION LAYER&amp;gt;/FeatureServer/&amp;lt;#&amp;gt;/query?f=json&amp;amp;where=...."&lt;/EM&gt;&lt;/LI&gt;&lt;LI&gt;Depending on how the query actions happen, you might be able to return a yes/no or T/F or 1/0 value directly, which could then be used to trigger a user-friendly confirmation or error message about the validity of the license number they entered.&lt;/LI&gt;&lt;/OL&gt;&lt;P&gt;It might be easier to do this using a small .JS script to handle the query to the feature layer ( pulldata("@javascript") in that case) and return a JSON object that you can then use pulldata("@json") on for the validation.&lt;BR /&gt;&lt;BR /&gt;You have a few ways to get there - feel free to DM me if you need a bit of extra help with this and I'll see if I can assist!&lt;/P&gt;</description>
      <pubDate>Fri, 29 Aug 2025 19:29:41 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-survey123-questions/create-a-constraint-based-on-values-in-another/m-p/1646962#M64011</guid>
      <dc:creator>MattEdrich</dc:creator>
      <dc:date>2025-08-29T19:29:41Z</dc:date>
    </item>
    <item>
      <title>Re: Create a constraint based on values in another feature class field?</title>
      <link>https://community.esri.com/t5/arcgis-survey123-questions/create-a-constraint-based-on-values-in-another/m-p/1647017#M64024</link>
      <description>&lt;P&gt;Thank you so much.&amp;nbsp;&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;My pull data request is not working.&amp;nbsp; I am worndering if this should work in survey123 connect before publishing.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This is the WhereContr calculation:&lt;BR /&gt;&lt;EM&gt;concat("CONTRACTNO='",${ApplicantContractorsLic},"'")&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;BR /&gt;&lt;/STRONG&gt;The where concatenation returns this&amp;nbsp;CONTRACTNO='123456'&lt;BR /&gt;CONTRACTNO is a string field so I put it in quotes&lt;/P&gt;&lt;P&gt;I put this in the calculation field of another text field to see if it would return the CONTRACTNO:&lt;BR /&gt;&lt;EM&gt;pulldata("@layer","getValue", "attributes.CONTRACTNO","&lt;A href="https://services.arcgis.com/xyzxyzxy/arcgis/rest/services/EXAMPLELicenses/FeatureServer/0" target="_blank"&gt;https://services.arcgis.com/xyzxyzxy/arcgis/rest/services/EXAMPLELicenses/FeatureServer/0&lt;/A&gt;", ${WhereContr})&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;I get values when directly putting this in the browser similar to this:&lt;BR /&gt;&lt;EM&gt;&lt;A href="https://services.arcgis.com/xyzxyzxy/arcgis/rest/services/EXAMPLELicenses/FeatureServer/0/query?where=CONTRACTNO='360928'&amp;amp;outFields=CONTRACTNO&amp;amp;f=json" target="_blank"&gt;https://services.arcgis.com/xyzxyzxy/arcgis/rest/services/EXAMPLELicenses/FeatureServer/0/query?where=CONTRACTNO='123456'&amp;amp;outFields=CONTRACTNO&amp;amp;f=json&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 29 Aug 2025 22:33:48 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-survey123-questions/create-a-constraint-based-on-values-in-another/m-p/1647017#M64024</guid>
      <dc:creator>mklatt_cityofventura_ca_gov</dc:creator>
      <dc:date>2025-08-29T22:33:48Z</dc:date>
    </item>
    <item>
      <title>Re: Create a constraint based on values in another feature class field?</title>
      <link>https://community.esri.com/t5/arcgis-survey123-questions/create-a-constraint-based-on-values-in-another/m-p/1647030#M64025</link>
      <description>&lt;P&gt;Try it with just this:&amp;nbsp;&lt;EM&gt;concat("CONTRACTNO=",${ApplicantContractorsLic})&lt;/EM&gt;&lt;/P&gt;</description>
      <pubDate>Sat, 30 Aug 2025 00:28:14 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-survey123-questions/create-a-constraint-based-on-values-in-another/m-p/1647030#M64025</guid>
      <dc:creator>Neal_t_k</dc:creator>
      <dc:date>2025-08-30T00:28:14Z</dc:date>
    </item>
    <item>
      <title>Re: Create a constraint based on values in another feature class field?</title>
      <link>https://community.esri.com/t5/arcgis-survey123-questions/create-a-constraint-based-on-values-in-another/m-p/1647341#M64031</link>
      <description>&lt;P&gt;Unfortunately this didnt work either.&lt;/P&gt;</description>
      <pubDate>Tue, 02 Sep 2025 14:58:56 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-survey123-questions/create-a-constraint-based-on-values-in-another/m-p/1647341#M64031</guid>
      <dc:creator>mklatt_cityofventura_ca_gov</dc:creator>
      <dc:date>2025-09-02T14:58:56Z</dc:date>
    </item>
    <item>
      <title>Re: Create a constraint based on values in another feature class field?</title>
      <link>https://community.esri.com/t5/arcgis-survey123-questions/create-a-constraint-based-on-values-in-another/m-p/1647351#M64032</link>
      <description>&lt;P&gt;hmmm,&amp;nbsp; &amp;nbsp;So I&amp;nbsp; recreated this with sample data and the workflow does work. And it appears from your test that your feature layer is queryable, so I am guessing that it is just a syntax error.&amp;nbsp;&lt;/P&gt;&lt;P&gt;From here I would work backward, and start with hard coding your where clause ensuring you get something that works and once you have it working with a static url, move that syntax for the where clause to the helper question with the dynamic field as above.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;pulldata("@layer","getValue", "attributes.CONTRACTNO","&lt;A href="https://services.arcgis.com/xyzxyzxy/arcgis/rest/services/EXAMPLELicenses/FeatureServer/0" target="_blank" rel="nofollow noopener noreferrer"&gt;https://services.arcgis.com/xyzxyzxy/arcgis/rest/services/EXAMPLELicenses/FeatureServer/0&lt;/A&gt;", &lt;FONT color="#FF0000"&gt;"CONTRACTNO=xyzxyzx"&lt;/FONT&gt;)&amp;nbsp; &amp;nbsp;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;or&amp;nbsp;&lt;FONT color="#FF0000"&gt;'CONTRACTNO="xyzxyzx"'&amp;nbsp; &lt;/FONT&gt;&lt;/EM&gt;&lt;FONT color="#000000"&gt;trying various syntax until you get it to return the correct license number.&lt;/FONT&gt;&lt;FONT color="#FF0000"&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 02 Sep 2025 15:19:48 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-survey123-questions/create-a-constraint-based-on-values-in-another/m-p/1647351#M64032</guid>
      <dc:creator>Neal_t_k</dc:creator>
      <dc:date>2025-09-02T15:19:48Z</dc:date>
    </item>
    <item>
      <title>Re: Create a constraint based on values in another feature class field?</title>
      <link>https://community.esri.com/t5/arcgis-survey123-questions/create-a-constraint-based-on-values-in-another/m-p/1647365#M64033</link>
      <description>&lt;P&gt;Got it to work using the above format.&amp;nbsp; I used single quotes around the text in the where clause&lt;BR /&gt;concat("CONTRACTNO='",${ApplicantContractorsLic}, "'")&lt;/P&gt;&lt;P&gt;Thank you for the help!&lt;/P&gt;</description>
      <pubDate>Tue, 02 Sep 2025 15:44:06 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-survey123-questions/create-a-constraint-based-on-values-in-another/m-p/1647365#M64033</guid>
      <dc:creator>mklatt_cityofventura_ca_gov</dc:creator>
      <dc:date>2025-09-02T15:44:06Z</dc:date>
    </item>
    <item>
      <title>Re: Create a constraint based on values in another feature class field?</title>
      <link>https://community.esri.com/t5/arcgis-survey123-questions/create-a-constraint-based-on-values-in-another/m-p/1647369#M64034</link>
      <description>&lt;P&gt;Glad it is working,&amp;nbsp; interesting that it didn't work previously, it appears to be the same as in your previous post.&amp;nbsp; Sometimes getting the syntax correct is the hardest part.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Neal_t_k_0-1756828099554.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/139753iE53EC83C9F5854C4/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Neal_t_k_0-1756828099554.png" alt="Neal_t_k_0-1756828099554.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 02 Sep 2025 15:49:52 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-survey123-questions/create-a-constraint-based-on-values-in-another/m-p/1647369#M64034</guid>
      <dc:creator>Neal_t_k</dc:creator>
      <dc:date>2025-09-02T15:49:52Z</dc:date>
    </item>
    <item>
      <title>Re: Create a constraint based on values in another feature class field?</title>
      <link>https://community.esri.com/t5/arcgis-survey123-questions/create-a-constraint-based-on-values-in-another/m-p/1647400#M64035</link>
      <description>&lt;P&gt;Yeah, likely was the syntax somewhere else, I retyped everything out.&amp;nbsp; Initially, it might have been some of the quotes in other spots.&amp;nbsp; I lazily used word to type this out originally. The Word document quotes sometimes cause issues.&lt;/P&gt;</description>
      <pubDate>Tue, 02 Sep 2025 17:50:13 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-survey123-questions/create-a-constraint-based-on-values-in-another/m-p/1647400#M64035</guid>
      <dc:creator>mklatt_cityofventura_ca_gov</dc:creator>
      <dc:date>2025-09-02T17:50:13Z</dc:date>
    </item>
  </channel>
</rss>

