<?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 JavaScript Errors for Resubmissions in ArcGIS Survey123 Questions</title>
    <link>https://community.esri.com/t5/arcgis-survey123-questions/javascript-errors-for-resubmissions/m-p/1208655#M44599</link>
    <description>&lt;P&gt;I used the Survey123 Connect app to build my survey. I had to use some bespoke JavaScript functions to extract the labels for the users responses to &lt;STRONG&gt;multi-response&lt;/STRONG&gt; dependent drop-down list questions. These are in the form of a calculate field. I also have single-response DDDL questions, and there I was fortunately able to use &lt;SPAN&gt;jr:choice-name(selected-at(...&lt;/SPAN&gt;)).&lt;/P&gt;&lt;P&gt;The issue is, once a user has submitted an entry, which I know for sure that they do through the Survey123 Field app and not through the website-hosted survey, when they go through either their Sent or Inbox folder to edit and resubmit their entry, the JavaScript functions are not recalculated. A JavaScript error is produced for all survey questions that used either the bespoke JavaScript or even &lt;SPAN&gt;jr:choice-name(selected-at(...&lt;/SPAN&gt;)) functions.&lt;/P&gt;&lt;P&gt;I know that the issue is not solved if we remove user access to either the Sent or the Inbox folder, as I tried both of these and the error pursued. Furthermore, I read online about a mysterious 'Recalculate' button, but this does not appear on my survey, even when I make sure that none of the calculate fields re 'hidden'.&lt;/P&gt;&lt;P&gt;I have tried many different ways to solve this problem, but the errors persist, and I'm entirely fresh out of ideas... please please please could someone let me know if there is a solution to this?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I will attach the JavaScript file and the function calling it from the 'calculation' field in the 'survey' sheet of the Survey123 spreadsheet, &lt;EM&gt;but I really don't think that this is the problem&lt;/EM&gt;. These scripts work when submitting, just not when a user resubmits their entry. Note that the user doesn't even have to modify anything in the form for the error to still occur upon resubmission.&lt;/P&gt;&lt;P&gt;The JavaScript is attached, and is called via&lt;BR /&gt;&lt;SPAN&gt;if(${formattype_dataset} != "",pulldata("@javascript", "multichoicelabel.js", "mchoicelabel",${formattype_dataset},string('formattypespread;formattypespatial;formattypedocument;formattypewebapp;formattypeother'),string('Spreadsheet;GIS;Document;Website;Other)')),"")&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;where the first 'string(...)' corresponds to the coded 'name' column in the 'choices' sheet, and the second 'string(...)' corresponds to the 'label' column value for that specific coded name.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Thu, 01 Sep 2022 13:45:30 GMT</pubDate>
    <dc:creator>HamishPatten</dc:creator>
    <dc:date>2022-09-01T13:45:30Z</dc:date>
    <item>
      <title>JavaScript Errors for Resubmissions</title>
      <link>https://community.esri.com/t5/arcgis-survey123-questions/javascript-errors-for-resubmissions/m-p/1208655#M44599</link>
      <description>&lt;P&gt;I used the Survey123 Connect app to build my survey. I had to use some bespoke JavaScript functions to extract the labels for the users responses to &lt;STRONG&gt;multi-response&lt;/STRONG&gt; dependent drop-down list questions. These are in the form of a calculate field. I also have single-response DDDL questions, and there I was fortunately able to use &lt;SPAN&gt;jr:choice-name(selected-at(...&lt;/SPAN&gt;)).&lt;/P&gt;&lt;P&gt;The issue is, once a user has submitted an entry, which I know for sure that they do through the Survey123 Field app and not through the website-hosted survey, when they go through either their Sent or Inbox folder to edit and resubmit their entry, the JavaScript functions are not recalculated. A JavaScript error is produced for all survey questions that used either the bespoke JavaScript or even &lt;SPAN&gt;jr:choice-name(selected-at(...&lt;/SPAN&gt;)) functions.&lt;/P&gt;&lt;P&gt;I know that the issue is not solved if we remove user access to either the Sent or the Inbox folder, as I tried both of these and the error pursued. Furthermore, I read online about a mysterious 'Recalculate' button, but this does not appear on my survey, even when I make sure that none of the calculate fields re 'hidden'.&lt;/P&gt;&lt;P&gt;I have tried many different ways to solve this problem, but the errors persist, and I'm entirely fresh out of ideas... please please please could someone let me know if there is a solution to this?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I will attach the JavaScript file and the function calling it from the 'calculation' field in the 'survey' sheet of the Survey123 spreadsheet, &lt;EM&gt;but I really don't think that this is the problem&lt;/EM&gt;. These scripts work when submitting, just not when a user resubmits their entry. Note that the user doesn't even have to modify anything in the form for the error to still occur upon resubmission.&lt;/P&gt;&lt;P&gt;The JavaScript is attached, and is called via&lt;BR /&gt;&lt;SPAN&gt;if(${formattype_dataset} != "",pulldata("@javascript", "multichoicelabel.js", "mchoicelabel",${formattype_dataset},string('formattypespread;formattypespatial;formattypedocument;formattypewebapp;formattypeother'),string('Spreadsheet;GIS;Document;Website;Other)')),"")&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;where the first 'string(...)' corresponds to the coded 'name' column in the 'choices' sheet, and the second 'string(...)' corresponds to the 'label' column value for that specific coded name.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 01 Sep 2022 13:45:30 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-survey123-questions/javascript-errors-for-resubmissions/m-p/1208655#M44599</guid>
      <dc:creator>HamishPatten</dc:creator>
      <dc:date>2022-09-01T13:45:30Z</dc:date>
    </item>
  </channel>
</rss>

