<?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 Fill out 1 survey, autofill and create multiple features in ArcGIS Survey123 Questions</title>
    <link>https://community.esri.com/t5/arcgis-survey123-questions/fill-out-1-survey-autofill-and-create-multiple/m-p/1386815#M55005</link>
    <description>&lt;P&gt;hey all,&lt;/P&gt;&lt;P&gt;I work for a utility company and I'm building a survey where the user enters data about a leak and a work order to repair the leak. "Leaks" being the primary layer, and "Work_Orders" being a repeat. What I'm trying to do is have the user fill in a single work order (WO) while automatically creating 2 WOs. The first WO has a wo_type of either "service_leak" or "main_leak". I'd like the second WO to autofill all the same values except the wo_type would now be "recheck"&lt;/P&gt;&lt;P&gt;My instinct is to use indexed-repeat() but I may be misunderstanding how to use it. In the calculation column for the "wo_type" field I've put indexed-repeat(${wo_type}, ${Work_Orders}, 1). It comes back with a cycle dependency error.&lt;/P&gt;&lt;P&gt;Is there another way to achieve this?&lt;/P&gt;&lt;P&gt;Thanks in advance!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Mon, 26 Feb 2024 16:13:43 GMT</pubDate>
    <dc:creator>KellyTaylor</dc:creator>
    <dc:date>2024-02-26T16:13:43Z</dc:date>
    <item>
      <title>Fill out 1 survey, autofill and create multiple features</title>
      <link>https://community.esri.com/t5/arcgis-survey123-questions/fill-out-1-survey-autofill-and-create-multiple/m-p/1386815#M55005</link>
      <description>&lt;P&gt;hey all,&lt;/P&gt;&lt;P&gt;I work for a utility company and I'm building a survey where the user enters data about a leak and a work order to repair the leak. "Leaks" being the primary layer, and "Work_Orders" being a repeat. What I'm trying to do is have the user fill in a single work order (WO) while automatically creating 2 WOs. The first WO has a wo_type of either "service_leak" or "main_leak". I'd like the second WO to autofill all the same values except the wo_type would now be "recheck"&lt;/P&gt;&lt;P&gt;My instinct is to use indexed-repeat() but I may be misunderstanding how to use it. In the calculation column for the "wo_type" field I've put indexed-repeat(${wo_type}, ${Work_Orders}, 1). It comes back with a cycle dependency error.&lt;/P&gt;&lt;P&gt;Is there another way to achieve this?&lt;/P&gt;&lt;P&gt;Thanks in advance!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 26 Feb 2024 16:13:43 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-survey123-questions/fill-out-1-survey-autofill-and-create-multiple/m-p/1386815#M55005</guid>
      <dc:creator>KellyTaylor</dc:creator>
      <dc:date>2024-02-26T16:13:43Z</dc:date>
    </item>
    <item>
      <title>Re: Fill out 1 survey, autofill and create multiple features</title>
      <link>https://community.esri.com/t5/arcgis-survey123-questions/fill-out-1-survey-autofill-and-create-multiple/m-p/1387503#M55055</link>
      <description>&lt;P&gt;if anyone stumbles upon this and is struggling to do the same thing, I finally found a solution&amp;nbsp;&lt;A href="https://community.esri.com/t5/arcgis-survey123-questions/prepopulate-answers-in-a-repeat-with-last-values/m-p/1093928" target="_self"&gt;here.&lt;/A&gt;&lt;/P&gt;&lt;P&gt;Here's my javascript function:&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;function getValue(position, repeat, field) {
	if (position == 2){
		return repeat[0][field]	
	}
}&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;and here's what I put in the calculation column in the xlsform:&lt;/P&gt;&lt;LI-CODE lang="c"&gt;pulldata("@javascript", "functions.js", "getValue", position(..), ${Work_Orders}, 'premise' )&lt;/LI-CODE&gt;&lt;P&gt;with Work_Orders being the name of the repeat, and premise being the name of the field I'm copying over.&lt;/P&gt;&lt;P&gt;I had to put this in a null field called 'premise_null' and then set the 'premise' calculation to ${premise_null} in order to avoid yet another cycle dependency error&amp;nbsp;&lt;span class="lia-unicode-emoji" title=":thinking_face:"&gt;🤔&lt;/span&gt;&lt;/P&gt;&lt;P&gt;It's probably not ideal if you have a lot of fields to carry over because it'd need to run the .js for each field. If this was an issue for me, I'd write a js function that would return all the necessary fields in an array, store that in a null field in the xlsform, and then access each item in the array using calculations.&lt;/P&gt;&lt;P&gt;Good luck to anyone trying to do this! It took me forever to finally find a solution. It would be lovely if indexed-repeat could refer to earlier entries of the same field without a cycle dependency error.&lt;/P&gt;</description>
      <pubDate>Tue, 27 Feb 2024 16:23:18 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-survey123-questions/fill-out-1-survey-autofill-and-create-multiple/m-p/1387503#M55055</guid>
      <dc:creator>KellyTaylor</dc:creator>
      <dc:date>2024-02-27T16:23:18Z</dc:date>
    </item>
  </channel>
</rss>

