<?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: pulldata() and select_multiple data relationships in ArcGIS Survey123 Questions</title>
    <link>https://community.esri.com/t5/arcgis-survey123-questions/pulldata-and-select-multiple-data-relationships/m-p/1154399#M41349</link>
    <description>&lt;P&gt;Would you be able to please share a small snippet on how that setup looks? I think that can theoretically work for me as long as I can get things to auto-select as well within that select_multiple which would be based on a previous select_multiple question.&lt;/P&gt;&lt;P&gt;Thanks!&lt;/P&gt;</description>
    <pubDate>Wed, 16 Mar 2022 17:38:21 GMT</pubDate>
    <dc:creator>AlexBakhtin</dc:creator>
    <dc:date>2022-03-16T17:38:21Z</dc:date>
    <item>
      <title>pulldata() and select_multiple data relationships</title>
      <link>https://community.esri.com/t5/arcgis-survey123-questions/pulldata-and-select-multiple-data-relationships/m-p/1154302#M41343</link>
      <description>&lt;P&gt;Hello everyone,&lt;/P&gt;&lt;P&gt;I am currently working on a form where I am utilizing pulldata() and select_multiple in tandem to pre-populate information into a different select_multiple field. My main question is:&lt;/P&gt;&lt;P&gt;Is it possible to have a select_multiple question dynamically select choices in a different select_multiple? I attached an example to this post where I'm using fruits and would like to have the colors automatically populate based on the selected fruits. Ideally I would like to utilize pulldata() as I can autogenerate the comma separated strings I need to automatically select the select_multiple choices from pulldata() but I would like to see what is possible with this setup. From my testing, I'm not able to reliably have all of the colors populate based on the selected fruits.&lt;/P&gt;</description>
      <pubDate>Wed, 16 Mar 2022 15:10:51 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-survey123-questions/pulldata-and-select-multiple-data-relationships/m-p/1154302#M41343</guid>
      <dc:creator>AlexBakhtin</dc:creator>
      <dc:date>2022-03-16T15:10:51Z</dc:date>
    </item>
    <item>
      <title>Re: pulldata() and select_multiple data relationships</title>
      <link>https://community.esri.com/t5/arcgis-survey123-questions/pulldata-and-select-multiple-data-relationships/m-p/1154347#M41345</link>
      <description>&lt;P&gt;I have a similar project where I am filtering the list of counties based on the state chosen.&amp;nbsp; I am not using pulldata().&amp;nbsp; In the choice_filter column of the .xlsx form, on the row asking for the county, I have a filter set looking at what was selected in the state field.&amp;nbsp; I have a separate .csv file stored in the media folder that lists the counties and the states they are in.&amp;nbsp; The filter looks for what counties have the state matching what the user entered for the state in the previous question.&lt;/P&gt;&lt;P&gt;Hope this helps.&lt;/P&gt;</description>
      <pubDate>Wed, 16 Mar 2022 16:09:53 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-survey123-questions/pulldata-and-select-multiple-data-relationships/m-p/1154347#M41345</guid>
      <dc:creator>BryndaHatch</dc:creator>
      <dc:date>2022-03-16T16:09:53Z</dc:date>
    </item>
    <item>
      <title>Re: pulldata() and select_multiple data relationships</title>
      <link>https://community.esri.com/t5/arcgis-survey123-questions/pulldata-and-select-multiple-data-relationships/m-p/1154399#M41349</link>
      <description>&lt;P&gt;Would you be able to please share a small snippet on how that setup looks? I think that can theoretically work for me as long as I can get things to auto-select as well within that select_multiple which would be based on a previous select_multiple question.&lt;/P&gt;&lt;P&gt;Thanks!&lt;/P&gt;</description>
      <pubDate>Wed, 16 Mar 2022 17:38:21 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-survey123-questions/pulldata-and-select-multiple-data-relationships/m-p/1154399#M41349</guid>
      <dc:creator>AlexBakhtin</dc:creator>
      <dc:date>2022-03-16T17:38:21Z</dc:date>
    </item>
    <item>
      <title>Re: pulldata() and select_multiple data relationships</title>
      <link>https://community.esri.com/t5/arcgis-survey123-questions/pulldata-and-select-multiple-data-relationships/m-p/1154409#M41350</link>
      <description>&lt;P&gt;this is from the .xls form&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="BryndaHatch_0-1647452674241.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/36516i20848C3B99533E60/image-size/medium?v=v2&amp;amp;px=400" role="button" title="BryndaHatch_0-1647452674241.png" alt="BryndaHatch_0-1647452674241.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;this is from the choices-boundaries02-counties.csv in the media folder&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="BryndaHatch_1-1647452766662.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/36518i15FA49970BA3899D/image-size/medium?v=v2&amp;amp;px=400" role="button" title="BryndaHatch_1-1647452766662.png" alt="BryndaHatch_1-1647452766662.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 16 Mar 2022 17:47:01 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-survey123-questions/pulldata-and-select-multiple-data-relationships/m-p/1154409#M41350</guid>
      <dc:creator>BryndaHatch</dc:creator>
      <dc:date>2022-03-16T17:47:01Z</dc:date>
    </item>
    <item>
      <title>Re: pulldata() and select_multiple data relationships</title>
      <link>https://community.esri.com/t5/arcgis-survey123-questions/pulldata-and-select-multiple-data-relationships/m-p/1157437#M41586</link>
      <description>&lt;P&gt;Ah understood - I am familiar with working with cascading selects like that however I'm wondering if it is possible to preform a calculation that would automatically select options in a select_multiple based on what you select on a previous select_multiple question?&lt;/P&gt;&lt;P&gt;I attached a quick video but in short, is it possible to have all of the food colors selected when all of the foods above are selected? With the way I have things set up currently, I can't seem to get it to work the way I would like.&lt;div class="lia-vid-container video-embed-center"&gt;&lt;div id="lia-vid-6301733793001w384h540r90" class="lia-video-brightcove-player-container"&gt;&lt;video-js data-video-id="6301733793001" data-account="6161463677001" data-player="default" data-embed="default" class="vjs-fluid" controls="" data-application-id="" style="width: 100%; height: 100%;"&gt;&lt;/video-js&gt;&lt;/div&gt;&lt;script src="https://players.brightcove.net/6161463677001/default_default/index.min.js"&gt;&lt;/script&gt;&lt;script&gt;(function() {  var wrapper = document.getElementById('lia-vid-6301733793001w384h540r90');  var videoEl = wrapper ? wrapper.querySelector('video-js') : null;  if (videoEl) {     if (window.videojs) {       window.videojs(videoEl).ready(function() {         this.on('loadedmetadata', function() {           this.el().querySelectorAll('.vjs-load-progress div[data-start]').forEach(function(bar) {             bar.setAttribute('role', 'presentation');             bar.setAttribute('aria-hidden', 'true');           });         });       });     }  }})();&lt;/script&gt;&lt;a class="video-embed-link" href="https://community.esri.com/t5/video/gallerypage/video-id/6301733793001"&gt;(view in My Videos)&lt;/a&gt;&lt;/div&gt;&lt;/P&gt;&lt;P&gt;The actual calculation is happening from a pulldata() function:&lt;/P&gt;&lt;LI-CODE lang="c"&gt;pulldata('color_csv', 'food_color', 'food_name', ${food_name})&lt;/LI-CODE&gt;&lt;P&gt;And the color_csv file contains the following contents:&lt;/P&gt;&lt;TABLE border="1" width="100%"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD width="50%"&gt;food_name&lt;/TD&gt;&lt;TD width="50%"&gt;food_color&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="50%"&gt;apple&lt;/TD&gt;&lt;TD width="50%"&gt;red&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="50%"&gt;pear&lt;/TD&gt;&lt;TD width="50%"&gt;green&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="50%"&gt;orange&lt;/TD&gt;&lt;TD width="50%"&gt;yellow,orange&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;</description>
      <pubDate>Thu, 24 Mar 2022 17:47:28 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-survey123-questions/pulldata-and-select-multiple-data-relationships/m-p/1157437#M41586</guid>
      <dc:creator>AlexBakhtin</dc:creator>
      <dc:date>2022-03-24T17:47:28Z</dc:date>
    </item>
    <item>
      <title>Re: pulldata() and select_multiple data relationships</title>
      <link>https://community.esri.com/t5/arcgis-survey123-questions/pulldata-and-select-multiple-data-relationships/m-p/1167096#M42310</link>
      <description>&lt;P&gt;For anyone interested, I figured out an acceptable workaround if anyone finds themselves in a situation where they need to auto-populate a select_multiple based on what was selected in a previous select_multiple question. I got the overall idea of how to do this from the &lt;A href="https://doc.arcgis.com/en/survey123/desktop/create-surveys/xlsformrepeats.htm#ESRI_SECTION1_9F07ECB9F1C341CF8A05AF54B1B011B0" target="_self"&gt;Repeats documentation&lt;/A&gt;.&amp;nbsp;&lt;/P&gt;&lt;OL&gt;&lt;LI&gt;Create a repeat that has a max repeat count of selected items in the first select_multiple using count-selected()&lt;/LI&gt;&lt;LI&gt;Inside of the repeat, use selected-at(${question_name}, pos(..)-1) to get each individual item selected into its own repeat.&lt;/LI&gt;&lt;LI&gt;Use pulldata() to get associated attributes of each selected item&lt;/LI&gt;&lt;LI&gt;Outside of the repeat, use join() to concatenate all attributes into a comma separated value&lt;/LI&gt;&lt;LI&gt;Remove duplicate entries in the comma separated value (otherwise when you go to submit it will fail). I wrote a function to accomplish this in Javascript&amp;amp;colon;&lt;/LI&gt;&lt;/OL&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;function dupeclear(ppe_formatted_text) {

    var x = ppe_formatted_text.toString();
    x = Array.from(new Set(x.split(',')));
    return x;
}​&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;6.&amp;nbsp;Use the cleaned up concatenated value as a calculation for the second select_multiple.&lt;/P&gt;&lt;P&gt;Please note that the only downside to this method is that you need to cycle through each repeat manually to get the text field outside of the repeat to pull each value in. Once I figure out how to do that through a calculation (if possible) I will update the post.&lt;/P&gt;&lt;P&gt;I probably didn't do the best job in writing this out so I'm also attaching the final sample workflow along with some notes in the hints of each field to this post.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 22 Apr 2022 16:50:30 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-survey123-questions/pulldata-and-select-multiple-data-relationships/m-p/1167096#M42310</guid>
      <dc:creator>AlexBakhtin</dc:creator>
      <dc:date>2022-04-22T16:50:30Z</dc:date>
    </item>
  </channel>
</rss>

