<?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: check value from inbox for readonly control. in ArcGIS Survey123 Questions</title>
    <link>https://community.esri.com/t5/arcgis-survey123-questions/check-value-from-inbox-for-readonly-control/m-p/1673614#M64997</link>
    <description>&lt;P&gt;I don't think that is possible through survey123 itself. However, you could add a hidden field (yes,no) have it default set to no,&amp;nbsp; Have your value question in the read-only column set to ${&amp;lt;helper_field&amp;gt;}='yes'.&amp;nbsp; Then write a python script to post process the helper field based on the entry.&lt;/P&gt;&lt;P&gt;Something like this to get you started (I haven't tested it so it may need adjusting but should be close):&lt;/P&gt;&lt;LI-CODE lang="python"&gt;from arcgis.gis import GIS

portalURL = "https://www.arcgis.com"
username = "USERNAME"
password = "PASSWORD"
feature_item_id = "&amp;lt;ItemID&amp;gt;"

gis = GIS(portalURL, username, password)
feature_item = gis.content.get(feature_item_id)
layers = feature_item.layers + feature_item.tables
for layer in layers:
    features = layer.query(where="1=1", order_by_fields='objectid ASC').features
    for feat in features:
        gid = feat.get_value('globalid')
        value = feat.get_value('value')
        value_length = len(value) if value is not None else 0
        if value_length &amp;gt; 0:
            where_clause = f"globalid='{gid}'"            
            layer.calculate(where=where_clause, calc_expression={"field": 'helperfield', "value": 'yes'})&lt;/LI-CODE&gt;&lt;P&gt;This will loop through all layers and tables, you can adjust to a specific one if needed.&lt;/P&gt;&lt;P&gt;edit: Changed this line:&amp;nbsp;value_length = len(value) &amp;nbsp; &amp;nbsp;to this:&amp;nbsp; value_length = len(value) if value is not None else 0&lt;/P&gt;</description>
    <pubDate>Wed, 17 Dec 2025 22:19:34 GMT</pubDate>
    <dc:creator>Neal_t_k</dc:creator>
    <dc:date>2025-12-17T22:19:34Z</dc:date>
    <item>
      <title>check value from inbox for readonly control.</title>
      <link>https://community.esri.com/t5/arcgis-survey123-questions/check-value-from-inbox-for-readonly-control/m-p/1673534#M64994</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;Is it possible to check if a record from the inbox has a value and if so, make it read only?&lt;/P&gt;&lt;P&gt;I've put this in the readonly column&amp;nbsp;&lt;STRONG&gt;&lt;EM&gt;if(string-length(${value})&amp;gt;1,'yes','')&lt;/EM&gt;&lt;/STRONG&gt;, it throws a dependency error because it's looking for itself.&lt;/P&gt;&lt;P&gt;Any happy is appreciated.&lt;/P&gt;&lt;P&gt;Regards,&amp;nbsp;&lt;/P&gt;&lt;P&gt;Elliott&lt;/P&gt;</description>
      <pubDate>Wed, 17 Dec 2025 09:17:56 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-survey123-questions/check-value-from-inbox-for-readonly-control/m-p/1673534#M64994</guid>
      <dc:creator>ElliottCarsonGF</dc:creator>
      <dc:date>2025-12-17T09:17:56Z</dc:date>
    </item>
    <item>
      <title>Re: check value from inbox for readonly control.</title>
      <link>https://community.esri.com/t5/arcgis-survey123-questions/check-value-from-inbox-for-readonly-control/m-p/1673614#M64997</link>
      <description>&lt;P&gt;I don't think that is possible through survey123 itself. However, you could add a hidden field (yes,no) have it default set to no,&amp;nbsp; Have your value question in the read-only column set to ${&amp;lt;helper_field&amp;gt;}='yes'.&amp;nbsp; Then write a python script to post process the helper field based on the entry.&lt;/P&gt;&lt;P&gt;Something like this to get you started (I haven't tested it so it may need adjusting but should be close):&lt;/P&gt;&lt;LI-CODE lang="python"&gt;from arcgis.gis import GIS

portalURL = "https://www.arcgis.com"
username = "USERNAME"
password = "PASSWORD"
feature_item_id = "&amp;lt;ItemID&amp;gt;"

gis = GIS(portalURL, username, password)
feature_item = gis.content.get(feature_item_id)
layers = feature_item.layers + feature_item.tables
for layer in layers:
    features = layer.query(where="1=1", order_by_fields='objectid ASC').features
    for feat in features:
        gid = feat.get_value('globalid')
        value = feat.get_value('value')
        value_length = len(value) if value is not None else 0
        if value_length &amp;gt; 0:
            where_clause = f"globalid='{gid}'"            
            layer.calculate(where=where_clause, calc_expression={"field": 'helperfield', "value": 'yes'})&lt;/LI-CODE&gt;&lt;P&gt;This will loop through all layers and tables, you can adjust to a specific one if needed.&lt;/P&gt;&lt;P&gt;edit: Changed this line:&amp;nbsp;value_length = len(value) &amp;nbsp; &amp;nbsp;to this:&amp;nbsp; value_length = len(value) if value is not None else 0&lt;/P&gt;</description>
      <pubDate>Wed, 17 Dec 2025 22:19:34 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-survey123-questions/check-value-from-inbox-for-readonly-control/m-p/1673614#M64997</guid>
      <dc:creator>Neal_t_k</dc:creator>
      <dc:date>2025-12-17T22:19:34Z</dc:date>
    </item>
    <item>
      <title>Re: check value from inbox for readonly control.</title>
      <link>https://community.esri.com/t5/arcgis-survey123-questions/check-value-from-inbox-for-readonly-control/m-p/1673843#M64998</link>
      <description>&lt;P&gt;Thanks Neal,&lt;/P&gt;&lt;P&gt;Unfortunately, this is required to work offline. But I might try and see if a script could be utilised.&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Elliott&lt;/P&gt;</description>
      <pubDate>Thu, 18 Dec 2025 01:52:39 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-survey123-questions/check-value-from-inbox-for-readonly-control/m-p/1673843#M64998</guid>
      <dc:creator>ElliottCarsonGF</dc:creator>
      <dc:date>2025-12-18T01:52:39Z</dc:date>
    </item>
    <item>
      <title>Re: check value from inbox for readonly control.</title>
      <link>https://community.esri.com/t5/arcgis-survey123-questions/check-value-from-inbox-for-readonly-control/m-p/1673973#M64999</link>
      <description>&lt;P&gt;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/946104"&gt;@ElliottCarsonGF&lt;/a&gt;&amp;nbsp;If post processing won't work,this might.&amp;nbsp; Instead of making it read-only you can make it not visible&amp;nbsp; using the&amp;nbsp;body::esri:visible field and base that on a calculated answer in a helper question.&amp;nbsp; You can add a note field in place of the read-only to show what the answer is. After testing, you can hide the helper field so once a user answers the question it is inaccessible.&amp;nbsp; Kind of hard to explain, attached is an example.&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Or, You could base the read-only status on providing answers on a subsequent question/s.&amp;nbsp; The limitations would be a user could un-answer the subsequent questions and make it not read-only or if they skipped ahead, the read-only status could be triggered prior to answering that question.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 18 Dec 2025 15:55:44 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-survey123-questions/check-value-from-inbox-for-readonly-control/m-p/1673973#M64999</guid>
      <dc:creator>Neal_t_k</dc:creator>
      <dc:date>2025-12-18T15:55:44Z</dc:date>
    </item>
  </channel>
</rss>

