<?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 Text field to record default answer if left blank in ArcGIS Survey123 Questions</title>
    <link>https://community.esri.com/t5/arcgis-survey123-questions/text-field-to-record-default-answer-if-left-blank/m-p/1144291#M40565</link>
    <description>&lt;P&gt;I have a survey with a select_multiple that queues different text fields based on their relevance. When these fields are relevant, I want them to remain blank. They are required fields and will be completed.&lt;/P&gt;&lt;P&gt;However, if the field is not relevant, I want the survey to record a default answer and NOT leave the field with a 'null' response.&lt;/P&gt;&lt;P&gt;if((string-length(${textfield})=0),'text',.) doesn't work - any other ideas? is my syntax correct? Do I need a different formula or approach?&lt;/P&gt;&lt;P&gt;Thanks!&lt;/P&gt;&lt;P&gt;RyanE&lt;/P&gt;</description>
    <pubDate>Tue, 15 Feb 2022 20:43:22 GMT</pubDate>
    <dc:creator>ryanEvanczyk</dc:creator>
    <dc:date>2022-02-15T20:43:22Z</dc:date>
    <item>
      <title>Text field to record default answer if left blank</title>
      <link>https://community.esri.com/t5/arcgis-survey123-questions/text-field-to-record-default-answer-if-left-blank/m-p/1144291#M40565</link>
      <description>&lt;P&gt;I have a survey with a select_multiple that queues different text fields based on their relevance. When these fields are relevant, I want them to remain blank. They are required fields and will be completed.&lt;/P&gt;&lt;P&gt;However, if the field is not relevant, I want the survey to record a default answer and NOT leave the field with a 'null' response.&lt;/P&gt;&lt;P&gt;if((string-length(${textfield})=0),'text',.) doesn't work - any other ideas? is my syntax correct? Do I need a different formula or approach?&lt;/P&gt;&lt;P&gt;Thanks!&lt;/P&gt;&lt;P&gt;RyanE&lt;/P&gt;</description>
      <pubDate>Tue, 15 Feb 2022 20:43:22 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-survey123-questions/text-field-to-record-default-answer-if-left-blank/m-p/1144291#M40565</guid>
      <dc:creator>ryanEvanczyk</dc:creator>
      <dc:date>2022-02-15T20:43:22Z</dc:date>
    </item>
    <item>
      <title>Re: Text field to record default answer if left blank</title>
      <link>https://community.esri.com/t5/arcgis-survey123-questions/text-field-to-record-default-answer-if-left-blank/m-p/1144704#M40587</link>
      <description>&lt;P&gt;You might be able to do this through temporary schema (bind::esri:fieldType = null). Write the default value to a first (hidden) temporary field...so it always holds the default value .&amp;nbsp; And then have the second temporary field shown (and required) when relevant. Then in your third field (the permanent, "final" field) write a calculation expression to populate it with the value of the first temporary field&amp;nbsp;&lt;EM&gt;if&lt;/EM&gt; the second temporary field is null, else if the second field is not null then populate with the second field. Something like,&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="c"&gt;if(${temp_field2} = '',${temp_field1}, ${temp_field2})&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 16 Feb 2022 16:26:33 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-survey123-questions/text-field-to-record-default-answer-if-left-blank/m-p/1144704#M40587</guid>
      <dc:creator>PaulPetersen1</dc:creator>
      <dc:date>2022-02-16T16:26:33Z</dc:date>
    </item>
    <item>
      <title>Re: Text field to record default answer if left blank</title>
      <link>https://community.esri.com/t5/arcgis-survey123-questions/text-field-to-record-default-answer-if-left-blank/m-p/1145127#M40607</link>
      <description>&lt;P&gt;If a question is&amp;nbsp;&lt;EM&gt;not relevant&lt;/EM&gt;, then Survey123 will always remove any value from the question. I would recommend using the &lt;STRONG&gt;body::esri:visible&lt;/STRONG&gt; column, instead of &lt;STRONG&gt;relevant&lt;/STRONG&gt;. This column works similar to relevant, except it does not clear out responses.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Once your questions are setup using body::esri:visible, you'll also need an if statement in your default column. For example, your body::esri:visible value would be something like: string-length(${textfield})=0. Then the default column would be: if(string-length(${textfield})=0,'text',.).&lt;/P&gt;&lt;P&gt;Hope this helps!&lt;/P&gt;</description>
      <pubDate>Thu, 17 Feb 2022 13:50:28 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-survey123-questions/text-field-to-record-default-answer-if-left-blank/m-p/1145127#M40607</guid>
      <dc:creator>KayleeRivera</dc:creator>
      <dc:date>2022-02-17T13:50:28Z</dc:date>
    </item>
    <item>
      <title>Re: Text field to record default answer if left blank</title>
      <link>https://community.esri.com/t5/arcgis-survey123-questions/text-field-to-record-default-answer-if-left-blank/m-p/1261039#M47615</link>
      <description>&lt;P&gt;Hi Kaylee,&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp;I'm hoping to apply your suggestion to a select_multiple field, but I'm not having success with what you've suggested. I read &lt;A href="https://doc.arcgis.com/en/survey123/desktop/create-surveys/xlsformformulas.htm#ESRI_SECTION1_2954BF95CF674951AE9691A656CF157C" target="_blank" rel="noopener"&gt;here&lt;/A&gt; that string-length will work on any field type, so I'm not sure what I'm missing.&lt;/P&gt;&lt;P&gt;I'd like a select_one list to show if certain choices are selected in the select_multiple field, but if those options aren't selected, I'd like a default value to be automatically entered. Basically, a '0' for 'absent'.&lt;/P&gt;&lt;P&gt;I added a string-length(${select_multiple})='choice' in the body::esri:visible column and if(string-length(${select_multiple}}='choice', ., 0) in the default column of the select_one field. Right now this doesn't show the select_single column if I do select that specific 'choice', nor does it default to 0.&lt;/P&gt;&lt;P&gt;Thanks for any help/insights you may be able to share!&lt;/P&gt;&lt;P&gt;Jess&lt;/P&gt;</description>
      <pubDate>Thu, 23 Feb 2023 18:17:04 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-survey123-questions/text-field-to-record-default-answer-if-left-blank/m-p/1261039#M47615</guid>
      <dc:creator>JessicaShue</dc:creator>
      <dc:date>2023-02-23T18:17:04Z</dc:date>
    </item>
    <item>
      <title>Re: Text field to record default answer if left blank</title>
      <link>https://community.esri.com/t5/arcgis-survey123-questions/text-field-to-record-default-answer-if-left-blank/m-p/1261120#M47619</link>
      <description>&lt;P&gt;Hi Jess,&lt;/P&gt;&lt;P&gt;I might need to see the XLS Form to get a better understanding of what you've got going on, but there are a couple of things you can check if your formulas aren't working out here.&lt;/P&gt;&lt;P&gt;The string-length function is going to output the number of characters in an answer. It looks like your formula of &lt;EM&gt;string-length(${select_multiple})='choice'&lt;/EM&gt; would never evaluate to true, since it's comparing a number to a text string.&lt;/P&gt;&lt;P&gt;So if I'm understanding correctly, you would want a formula in your select_one field's &lt;STRONG&gt;body::esri:visible&lt;/STRONG&gt; column that looks something like: &lt;EM&gt;if(selected(${select_multiple},'choice1') or selected(${select_multiple},'choice2') or selected(${select_multiple},'choice3'), true, false)&lt;/EM&gt;. This would make it so that your select_one question only shows if choice1, choice2, or choice3 are selected in your select_multiple question. (Note: please remember to use the "name", as opposed to the "label" of your choices for these calculations)&lt;/P&gt;&lt;P&gt;Then you can use a similar formula in the &lt;STRONG&gt;default&lt;/STRONG&gt; column for your select_one question to populate a 0 if the select_multiple doesn't meet your critera. Something like:&amp;nbsp;&lt;EM&gt;if(selected(${select_multiple},'choice1') or selected(${select_multiple},'choice2') or selected(${select_multiple},'choice3'), "", 0).&lt;/EM&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 23 Feb 2023 21:02:09 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-survey123-questions/text-field-to-record-default-answer-if-left-blank/m-p/1261120#M47619</guid>
      <dc:creator>KayleeRivera</dc:creator>
      <dc:date>2023-02-23T21:02:09Z</dc:date>
    </item>
    <item>
      <title>Re: Text field to record default answer if left blank</title>
      <link>https://community.esri.com/t5/arcgis-survey123-questions/text-field-to-record-default-answer-if-left-blank/m-p/1261585#M47648</link>
      <description>&lt;P&gt;Thank you for the suggestion! I had tried using a select expression, but not within an if statement in the &lt;STRONG&gt;body::esri:visible&lt;/STRONG&gt; field.&lt;/P&gt;&lt;P&gt;I now have the select_one field appearing when the option is selected. But the default value when the choice is not selected is showing as the formula of the&amp;nbsp;&lt;STRONG&gt;default&lt;/STRONG&gt; field. This is a snapshot for the select_one field:&lt;/P&gt;&lt;TABLE width="815"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD width="210"&gt;type&lt;/TD&gt;&lt;TD width="76"&gt;name&lt;/TD&gt;&lt;TD width="72"&gt;label&lt;/TD&gt;&lt;TD width="217"&gt;default&lt;/TD&gt;&lt;TD width="240"&gt;body::esri:visible&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;select_one list_name_cover_ALPE&lt;/TD&gt;&lt;TD&gt;cover_ALPE&lt;/TD&gt;&lt;TD&gt;ALPE cover&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;if(selected(${spcode},'ALPE'), "", 0)&lt;/TD&gt;&lt;TD&gt;if(selected(${spcode},'ALPE'),true,false)&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;</description>
      <pubDate>Fri, 24 Feb 2023 19:42:46 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-survey123-questions/text-field-to-record-default-answer-if-left-blank/m-p/1261585#M47648</guid>
      <dc:creator>JessicaShue</dc:creator>
      <dc:date>2023-02-24T19:42:46Z</dc:date>
    </item>
    <item>
      <title>Re: Text field to record default answer if left blank</title>
      <link>https://community.esri.com/t5/arcgis-survey123-questions/text-field-to-record-default-answer-if-left-blank/m-p/1279291#M48624</link>
      <description>&lt;P&gt;Hi &lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/214665"&gt;@JessicaShue&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;The select_one fields are string field by default, so you'd likely need to amend your calculation to wrap your 0 in quotes. Something like:&amp;nbsp;&lt;SPAN&gt;if(selected(${spcode},'ALPE'), '', '0')&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 17 Apr 2023 16:17:44 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-survey123-questions/text-field-to-record-default-answer-if-left-blank/m-p/1279291#M48624</guid>
      <dc:creator>KayleeRivera</dc:creator>
      <dc:date>2023-04-17T16:17:44Z</dc:date>
    </item>
  </channel>
</rss>

