<?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 Survey123 Pre-Select Questions in ArcGIS Survey123 Questions</title>
    <link>https://community.esri.com/t5/arcgis-survey123-questions/survey123-pre-select-questions/m-p/1213545#M44875</link>
    <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;We have a CSV file that stores product attributes, e.g., colors. In our survey, we would like the user to be able to update the colors for that product. When a user selects a product from a drop-down list, we want a read-only question that queries the CSV file and returns a list of the current colors for that product. This question would serve two purposes: 1) allow us to store the information in our database to see what the colors were before the user made any changes; 2) be FYI for the user so they can see the current colors.&lt;/P&gt;&lt;P&gt;Then, the second question would be a select_multiple question displaying a list of all available colors with the currently assigned colors pre-selected. The user would then be able to select/de-select the colors as necessary to update.&lt;/P&gt;&lt;P&gt;My questions are:&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;How would I create the first question? If using a custom Javascript to return an array, is there an example of the script I can reference? My first attempt at this was to use a select_one question with a choice filter that returns the values based on the product that the user selected in a previous question. However, the returned values are not stored when the user submits the survey.&lt;/LI&gt;&lt;LI&gt;For the second question, how would I design the question to return a list of all possible values with the currently assigned values pre-selected?&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;Thank you!&lt;/P&gt;</description>
    <pubDate>Fri, 16 Sep 2022 19:03:30 GMT</pubDate>
    <dc:creator>EmilyMalvini</dc:creator>
    <dc:date>2022-09-16T19:03:30Z</dc:date>
    <item>
      <title>Survey123 Pre-Select Questions</title>
      <link>https://community.esri.com/t5/arcgis-survey123-questions/survey123-pre-select-questions/m-p/1213545#M44875</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;We have a CSV file that stores product attributes, e.g., colors. In our survey, we would like the user to be able to update the colors for that product. When a user selects a product from a drop-down list, we want a read-only question that queries the CSV file and returns a list of the current colors for that product. This question would serve two purposes: 1) allow us to store the information in our database to see what the colors were before the user made any changes; 2) be FYI for the user so they can see the current colors.&lt;/P&gt;&lt;P&gt;Then, the second question would be a select_multiple question displaying a list of all available colors with the currently assigned colors pre-selected. The user would then be able to select/de-select the colors as necessary to update.&lt;/P&gt;&lt;P&gt;My questions are:&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;How would I create the first question? If using a custom Javascript to return an array, is there an example of the script I can reference? My first attempt at this was to use a select_one question with a choice filter that returns the values based on the product that the user selected in a previous question. However, the returned values are not stored when the user submits the survey.&lt;/LI&gt;&lt;LI&gt;For the second question, how would I design the question to return a list of all possible values with the currently assigned values pre-selected?&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;Thank you!&lt;/P&gt;</description>
      <pubDate>Fri, 16 Sep 2022 19:03:30 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-survey123-questions/survey123-pre-select-questions/m-p/1213545#M44875</guid>
      <dc:creator>EmilyMalvini</dc:creator>
      <dc:date>2022-09-16T19:03:30Z</dc:date>
    </item>
    <item>
      <title>Re: Survey123 Pre-Select Questions</title>
      <link>https://community.esri.com/t5/arcgis-survey123-questions/survey123-pre-select-questions/m-p/1213699#M44881</link>
      <description>&lt;P&gt;In Survey123, you can't use Javascript with local files - so no working with CSV files. To do what you want, you'd need to load the CSV to your server and convert it to a JSON and then work with the JSON.&lt;/P&gt;&lt;P&gt;But I don't think JS is the optimal solution for what you want to do. If I understand you correctly, this can all be accomplished quite easily using the 'pulldata' and 'select_one_from_file' functions and setting the default of the second question to the response for the first.&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm not sure what you mean when you say that&amp;nbsp;&lt;SPAN&gt;returned values are not stored when the user submits the survey. So long as the type isn't bound to null, it should be uploaded to the database.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="LaurenceTait_2-1663548457136.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/51514i244F0CDF3854EE2E/image-size/medium?v=v2&amp;amp;px=400" role="button" title="LaurenceTait_2-1663548457136.png" alt="LaurenceTait_2-1663548457136.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="LaurenceTait_1-1663548418927.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/51513iF03FA888C09DE7A6/image-size/medium?v=v2&amp;amp;px=400" role="button" title="LaurenceTait_1-1663548418927.png" alt="LaurenceTait_1-1663548418927.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 19 Sep 2022 00:50:05 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-survey123-questions/survey123-pre-select-questions/m-p/1213699#M44881</guid>
      <dc:creator>LaurenceTait</dc:creator>
      <dc:date>2022-09-19T00:50:05Z</dc:date>
    </item>
    <item>
      <title>Re: Survey123 Pre-Select Questions</title>
      <link>https://community.esri.com/t5/arcgis-survey123-questions/survey123-pre-select-questions/m-p/1213928#M44893</link>
      <description>&lt;P&gt;I was overthinking things. Thank you so much!! This worked.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 19 Sep 2022 19:00:50 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-survey123-questions/survey123-pre-select-questions/m-p/1213928#M44893</guid>
      <dc:creator>EmilyMalvini</dc:creator>
      <dc:date>2022-09-19T19:00:50Z</dc:date>
    </item>
  </channel>
</rss>

